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",