Skip to content

implement proper api returns#269

Open
runleveldev wants to merge 1 commit intomainfrom
rgingras/267-delete-pct-fix
Open

implement proper api returns#269
runleveldev wants to merge 1 commit intomainfrom
rgingras/267-delete-pct-fix

Conversation

@runleveldev
Copy link
Copy Markdown
Collaborator

This pull request updates the API and backend logic for deleting containers to provide more informative and consistent responses, especially for API clients. The main improvements are the switch from a 204 to a 200 response with a JSON body for successful deletions, better error handling with appropriate status codes and messages, and alignment between the OpenAPI spec and backend implementation.

API Response Improvements

  • The OpenAPI spec (openapi.yaml) now documents a 200 response with a JSON body (including a success message and DNS warnings) for successful container deletions, instead of a 204 with no content. It also adds a 400 response for bad requests.
  • The backend route (routers/containers.js) now returns a 200 JSON response with a message and DNS warnings on successful API deletes, matching the updated spec.

Error Handling Enhancements

  • API requests now receive specific JSON error responses and appropriate HTTP status codes (404 for not found, 400 for hostname mismatch, 500 for server errors) instead of generic or missing responses. [1] [2] [3] [4]

Consistency and Code Clean-up

  • The logic for handling API and non-API requests is unified and made more consistent, including improved error messages and redirects for UI users. [1] [2] [3] [4]

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