diff --git a/server/src/Http/Controllers/Api/v1/PlaceController.php b/server/src/Http/Controllers/Api/v1/PlaceController.php index dffb82b51..43c19bb6a 100644 --- a/server/src/Http/Controllers/Api/v1/PlaceController.php +++ b/server/src/Http/Controllers/Api/v1/PlaceController.php @@ -146,7 +146,7 @@ public function update($id, UpdatePlaceRequest $request) try { $place = $this->findPlaceOrFail($id); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { - return $this->apiError('Place resource not found.'); + return $this->apiError('Place resource not found.', 404); } // get request input @@ -253,7 +253,7 @@ public function find($id, Request $request) try { $place = $this->findPlaceOrFail($id); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { - return $this->apiError('Place resource not found.'); + return $this->apiError('Place resource not found.', 404); } return $this->placeResource($place); @@ -269,7 +269,7 @@ public function delete($id, Request $request) try { $place = $this->findPlaceOrFail($id); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { - return $this->apiError('Place resource not found.'); + return $this->apiError('Place resource not found.', 404); } $place->delete(); diff --git a/server/tests/ApiPlaceControllerContractsTest.php b/server/tests/ApiPlaceControllerContractsTest.php index 876329d9e..24f565876 100644 --- a/server/tests/ApiPlaceControllerContractsTest.php +++ b/server/tests/ApiPlaceControllerContractsTest.php @@ -537,5 +537,5 @@ function fleetopsApiPlace(array $attributes = []): FleetOpsApiPlaceEndpointFake ? $controller->update('missing-place', fleetopsUpdatePlaceRequest([])) : $controller->{$method}('missing-place', new Request()); - expect($response)->toBe(['apiError' => 'Place resource not found.', 'status' => 400]); + expect($response)->toBe(['apiError' => 'Place resource not found.', 'status' => 404]); })->with(['update', 'find', 'delete']);