mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 01:13:59 +00:00
Laravel Vapor - Fix an error in code that causes deployment fail
This commit is contained in:
+22
-10
@@ -16,18 +16,30 @@ use Illuminate\Http\JsonResponse;
|
||||
Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namespace' => 'AdminWorkFlow'], function () {
|
||||
|
||||
// Generalized JSON response function
|
||||
function jsonResponse($data = null, $message = null, $status = 200)
|
||||
{
|
||||
$response = ['message' => $message];
|
||||
// function jsonResponse($data = null, $message = null, $status = 200)
|
||||
// {
|
||||
// $response = ['message' => $message];
|
||||
|
||||
if ($data !== null) {
|
||||
$response['data'] = $data;
|
||||
// if ($data !== null) {
|
||||
// $response['data'] = $data;
|
||||
// }
|
||||
|
||||
// return response()->json($response, $status);
|
||||
// }
|
||||
|
||||
if (!function_exists('jsonResponse')) {
|
||||
function jsonResponse($data = null, $message = null, $status = 200)
|
||||
{
|
||||
$response = ['message' => $message];
|
||||
|
||||
if ($data !== null) {
|
||||
$response['data'] = $data;
|
||||
}
|
||||
|
||||
return response()->json($response, $status);
|
||||
}
|
||||
|
||||
return response()->json($response, $status);
|
||||
}
|
||||
|
||||
|
||||
Route::get('/fetch-oldest-order', function () {
|
||||
$booking = Booking::where('service_id', 4)
|
||||
->where('status', ApprovalStatus::APPROVED)
|
||||
@@ -147,9 +159,9 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
|
||||
if ($validator->fails()) {
|
||||
throw new RequestValidationException($validator->messages()->first());
|
||||
}
|
||||
|
||||
|
||||
$booking = Booking::find($request->booking_id);
|
||||
|
||||
|
||||
|
||||
if (!$booking) {
|
||||
return jsonResponse(null, 'Booking not found', 404);
|
||||
|
||||
Reference in New Issue
Block a user