Give a better response to listing no files on an asset

HTTP500 was never a good choice. Now it sends back an empty array
This commit is contained in:
Scarzy 2024-05-26 19:01:24 +01:00
parent b9d56a8ecc
commit 45329912e6

View file

@ -110,8 +110,8 @@ class AssetFilesController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', $files, trans('admin/hardware/message.upload.success'))); return response()->json(Helper::formatStandardApiResponse('success', $files, trans('admin/hardware/message.upload.success')));
} }
// There are no files. This possibly isn't the best response for this, but it does get the point across // There are no files.
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.download.no_match', ['id' => $fileId])), 500); return response()->json(Helper::formatStandardApiResponse('success', array(), trans('admin/hardware/message.upload.success')));
} }
// //