From 045fcfab72d85e345d888a443cefdc99c9de43a1 Mon Sep 17 00:00:00 2001 From: ncoronel Date: Thu, 27 Aug 2026 12:10:57 -0300 Subject: [PATCH] refactor(desfile): remove unused image deletion endpoint --- app/Domains/Desfile/Controllers/EntryController.php | 7 ------- app/Domains/Desfile/Services/EntryService.php | 13 ------------- app/Domains/Desfile/routes/api.php | 2 -- 3 files changed, 22 deletions(-) diff --git a/app/Domains/Desfile/Controllers/EntryController.php b/app/Domains/Desfile/Controllers/EntryController.php index 51e09db..d7968ae 100644 --- a/app/Domains/Desfile/Controllers/EntryController.php +++ b/app/Domains/Desfile/Controllers/EntryController.php @@ -10,7 +10,6 @@ use App\Domains\Desfile\Services\EntryService; use App\Http\Controllers\Controller; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -use Illuminate\Http\Response; class EntryController extends Controller { @@ -48,10 +47,4 @@ class EntryController extends Controller )); } - public function destroyImage(Request $request): Response - { - $this->entryService->deleteImage($request->user()->tenant()->firstOrFail()); - - return response()->noContent(); - } } diff --git a/app/Domains/Desfile/Services/EntryService.php b/app/Domains/Desfile/Services/EntryService.php index 0ddd1d1..684b7c4 100644 --- a/app/Domains/Desfile/Services/EntryService.php +++ b/app/Domains/Desfile/Services/EntryService.php @@ -166,19 +166,6 @@ class EntryService return $this->current($tenant); } - public function deleteImage(Tenant $tenant): void - { - $attachment = DB::transaction(function () use ($tenant): Attachment { - $entry = $this->entryQuery($tenant)->lockForUpdate()->firstOrFail(); - $attachment = $entry->allAttachments()->lockForUpdate()->firstOrFail(); - $entry->allAttachments()->detach($attachment->id); - - return $attachment; - }); - - $this->deleteIfUnused($attachment); - } - /** @return Collection */ private function itemAttributes(CatalogItem $entry): Collection { diff --git a/app/Domains/Desfile/routes/api.php b/app/Domains/Desfile/routes/api.php index 7827d3d..7ade5e7 100644 --- a/app/Domains/Desfile/routes/api.php +++ b/app/Domains/Desfile/routes/api.php @@ -14,6 +14,4 @@ Route::prefix('v1/adminapp/tenant/desfile') ->name('adminapp.desfile.entries.image.replace'); Route::patch('entries/image', [EntryController::class, 'updateImage']) ->name('adminapp.desfile.entries.image.update'); - Route::delete('entries/image', [EntryController::class, 'destroyImage']) - ->name('adminapp.desfile.entries.image.destroy'); });