Skip to content

fix(places): return 404 when a place isn't found - #373

Merged
roncodes merged 1 commit into
release/v0.6.72from
fix/places-not-found-404
Oct 9, 2026
Merged

roncodes merged 1 commit into
release/v0.6.72from
fix/places-not-found-404

Conversation

@roncodes

@roncodes roncodes commented Oct 9, 2026

Copy link
Copy Markdown
Member

Fixes #361

GET, PUT and DELETE /v1/places/{id} returned 400 Place resource not found. for an unknown id or another organization's place, because PlaceController::apiError() defaults to 400. Orders, vehicles, drivers and fleets return 404 in the same case.

Changes

  • Pass 404 at the three not-found call sites in Api/v1/PlaceController.
  • Update the contract test that pinned the old 400.

The lookup was already scoped to the company, so this only changes the status code.

Two related call sites stay as they are:

  • DriverController "Company not found." answers a bad company input on create, so 400 still fits.
  • CustomerController "Account not found." sits in the password-reset flow.

Tests

php scripts/pest-runner.php server/tests/ApiPlaceControllerContractsTest.php exits 0.

GET, PUT and DELETE /v1/places/{id} answered 400 for an unknown or
foreign place, unlike orders, vehicles, drivers and fleets.

Fixes #361
@roncodes
roncodes merged commit bd83ea4 into release/v0.6.72 Oct 9, 2026
4 of 6 checks passed
@roncodes
roncodes deleted the fix/places-not-found-404 branch October 9, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant