From e817b20840669bd7d3cae84ba91532883ae51cdf Mon Sep 17 00:00:00 2001 From: Scarzy Date: Wed, 1 May 2024 18:56:49 +0100 Subject: [PATCH] Fix some responses to be more appropriate Error/success was mixed up --- app/Http/Controllers/Api/AssetFilesController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/AssetFilesController.php b/app/Http/Controllers/Api/AssetFilesController.php index 6bcac9f679..cc2f339d3c 100644 --- a/app/Http/Controllers/Api/AssetFilesController.php +++ b/app/Http/Controllers/Api/AssetFilesController.php @@ -178,13 +178,12 @@ class AssetFilesController extends Controller } $log->delete(); - return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.deletefile.success')), 200); + return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.deletefile.success')), 200); } - return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.deletefile.success')), 200); + return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.deletefile.error')), 500); } - // Redirect to the hardware management page return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.deletefile.error')), 500); } }