Search restaurant API

This commit is contained in:
sayliraut
2024-06-20 13:05:03 +05:30
parent 0d11c2a76f
commit 2358f561bf
3 changed files with 132 additions and 74 deletions

View File

@@ -171,7 +171,7 @@ class RestaurantControllerApi extends Controller
}
}
/**
/**
* Created By : Sayli Raut
* Created at : 04 June 2024
* Use : To redeem restaurant.
@@ -198,4 +198,26 @@ class RestaurantControllerApi extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/**
* Created By : Sayli Raut
* Created at : 20 June 2024
* Use : To search from restaurant.
*/
public function searchRestaurant(Request $request)
{
try {
$token = readHeaderToken();
if ($token) {
$customerIamId = $token['sub'];
return $this->RestaurantApiServices->searchRestaurant($customerIamId, $request);
} else {
return jsonResponseWithErrorMessageApi(__('auth.user_deleted'), 409);
}
} catch (\Exception $e) {
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
}