From 204e0e8a140cb088c9a0ee96c642d822432aea04 Mon Sep 17 00:00:00 2001 From: mattamon Date: Thu, 16 Jan 2025 15:22:54 +0100 Subject: [PATCH] Make thumbnail clear available for images/videos/pdfs --- ...roller.php => ThumbnailClearController.php} | 18 +++++++++--------- translations/studio_api_docs.en.yaml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) rename src/Asset/Controller/{Image/ThumbnailImageClearController.php => ThumbnailClearController.php} (80%) diff --git a/src/Asset/Controller/Image/ThumbnailImageClearController.php b/src/Asset/Controller/ThumbnailClearController.php similarity index 80% rename from src/Asset/Controller/Image/ThumbnailImageClearController.php rename to src/Asset/Controller/ThumbnailClearController.php index a83eca04..30da0956 100644 --- a/src/Asset/Controller/Image/ThumbnailImageClearController.php +++ b/src/Asset/Controller/ThumbnailClearController.php @@ -14,7 +14,7 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ -namespace Pimcore\Bundle\StudioBackendBundle\Asset\Controller\Image; +namespace Pimcore\Bundle\StudioBackendBundle\Asset\Controller; use OpenApi\Attributes\Delete; use Pimcore\Bundle\StudioBackendBundle\Asset\Service\AssetServiceInterface; @@ -36,7 +36,7 @@ /** * @internal */ -final class ThumbnailImageClearController extends AbstractApiController +final class ThumbnailClearController extends AbstractApiController { use PaginatedResponseTrait; @@ -51,16 +51,16 @@ public function __construct( * @throws UserNotFoundException */ #[Route( - path: '/assets/{id}/image/thumbnail/clear', - name: 'pimcore_studio_api_clear_image_thumbnail', + path: '/assets/{id}/thumbnail/clear', + name: 'pimcore_studio_api_clear_thumbnail', methods: ['DELETE'] )] #[IsGranted(UserPermissions::ASSETS->value)] #[Delete( - path: self::PREFIX . '/assets/{id}/image/thumbnail/clear', - operationId: 'asset_image_clear_thumbnail', - description: 'asset_image_clear_thumbnail_description', - summary: 'asset_image_clear_thumbnail_summary', + path: self::PREFIX . '/assets/{id}/thumbnail/clear', + operationId: 'asset_clear_thumbnail', + description: 'asset_clear_thumbnail_description', + summary: 'asset_clear_thumbnail_summary', tags: [Tags::Assets->value] )] #[IdParameter(type: ElementTypes::TYPE_ASSET)] @@ -70,7 +70,7 @@ public function __construct( HttpResponseCodes::NOT_FOUND, HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] - public function clearImageThumbnails(int $id): Response + public function clearThumbnails(int $id): Response { $this->assetService->clearThumbnails($id); diff --git a/translations/studio_api_docs.en.yaml b/translations/studio_api_docs.en.yaml index 36785a83..9ec9061c 100644 --- a/translations/studio_api_docs.en.yaml +++ b/translations/studio_api_docs.en.yaml @@ -103,8 +103,8 @@ asset_get_tree_summary: Get all asset data for the tree asset_image_create_thumbnail_description: | Create a new image thumbnail based on the provided {id} and configuration parameters.
The {id} must be an ID of existing asset image -asset_image_clear_thumbnail_summary: Clear image thumbnail by ID -asset_image_clear_thumbnail_description: | +asset_clear_thumbnail_summary: Clear image thumbnail by ID +asset_clear_thumbnail_description: | Clear the image thumbnail based on the provided {id}.
The {id} must be an ID of existing asset image asset_image_download_by_format_success_response: Image asset binary file based on format