Skip to content

Conversation

@jameswhite-cmd
Copy link

Backend

  • Add a standard APIError model (documented in OpenAPI) to describe error responses: {error, field, message}.
  • Update POST /users and POST /users/signup to return HTTP 409 with a consistent JSON shape when an email is already in use (JSONResponse with {"error":"conflict","field":"email","message":"Already in use"}).
  • Add OpenAPI response documentation for 409 on these endpoints.
  • Update backend tests to expect 409 + the new error payload.

Frontend

  • Update signup flow to accept ApiError and call setError when the API returns 409 conflict, mapping the APIError.field/message to an inline form error.
  • Update Playwright test to attempt a duplicate signup and assert the inline message "Already in use" is visible.

Notes

  • This makes duplicate signup handling consistent across the API surface and UX, and documents the error model in OpenAPI. Backend unit tests and the updated Playwright test were adjusted accordingly.

This pull request was co-created with Cosine Genie

Original Task: full-stack-demo/4ob4p3l1v8ki
Author: James White

…end maps conflict to inline signup field error

Co-authored-by: Genie <[email protected]>
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