no file error

This commit is contained in:
glovetleong
2022-04-29 09:09:58 +08:00
parent ac690be428
commit 7756726ea8
2 changed files with 4 additions and 2 deletions
@@ -45,7 +45,9 @@ class DownloadBookingDocumentLogic
})->get();
if (!count($bookings)) throw new MalformedRequestException('No available file to download');
if (!count($bookings)) {
return response()->json(['no file to download']);
}
foreach ($bookings as $booking) {
@@ -15,7 +15,7 @@ class DownloadBookingDocumentController
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function download(Request $request, DownloadBookingDocumentLogic $logic) {
$logic->execute($request);
return $logic->execute($request);
}
}