From 230a2bb7bec57e1e5a70fa8e2e45a99f58591801 Mon Sep 17 00:00:00 2001 From: theEvilReaper Date: Thu, 27 Aug 2026 10:23:58 +0200 Subject: [PATCH] chore(font): add missing update endpoint --- .../controller/font/FontController.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/main/java/net/onelitefeather/vulpes/backend/controller/font/FontController.java b/src/main/java/net/onelitefeather/vulpes/backend/controller/font/FontController.java index 9cbc355..d82c436 100644 --- a/src/main/java/net/onelitefeather/vulpes/backend/controller/font/FontController.java +++ b/src/main/java/net/onelitefeather/vulpes/backend/controller/font/FontController.java @@ -107,6 +107,38 @@ public HttpResponse getById(@PathVariable UUID projectId, return HttpResponse.notFound(new FontModelErrorDTO("Font not found")); } + @Operation( + summary = "Update an existing font", + operationId = "updateFont", + description = "Updates a font in the given project.", + tags = {"Font"} + ) + @ApiResponse( + responseCode = "200", + description = "The font was successfully updated.", + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = FontModelResponseDTO.FontModelDTO.class) + ) + ) + @ApiResponse( + responseCode = "404", + description = "The font or project was not found.", + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = FontModelErrorDTO.class) + ) + ) + @Post("/update") + @Produces(MediaType.APPLICATION_JSON) + public HttpResponse update(@PathVariable UUID projectId, @Body FontModelDTO item) { + FontModelResponseDTO result = fontService.update(projectId, item); + if (result instanceof FontModelErrorDTO) { + return HttpResponse.notFound(result); + } + return HttpResponse.ok(result); + } + @Operation( summary = "Remove a font by ID", operationId = "deleteFont",