feat: add GET /things/get and POST /things/delete endpoints#32
Open
intagold561 wants to merge 1 commit into
Open
feat: add GET /things/get and POST /things/delete endpoints#32intagold561 wants to merge 1 commit into
intagold561 wants to merge 1 commit into
Conversation
- Add GET /things/get endpoint to retrieve a single thing by thing_id - Add POST /things/delete endpoint to remove a thing by thing_id - Add removeThing method to database client - Add comprehensive tests for both new endpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n\nAdds two missing CRUD endpoints for the things resource:\n\n### New Endpoints\n\n- GET /things/get?thing_id=ID — Retrieve a single thing by its ID. Returns 404 if not found.\n- POST /things/delete — Delete a thing by thing_id.\n\n### Changes\n\n-
routes/things/get.ts— New endpoint with query param validation via zod\n-routes/things/delete.ts— New endpoint with JSON body validation via zod\n-lib/db/db-client.ts— AddedremoveThing(thing_id)method to the database store\n-tests/routes/things/get.test.ts— Tests for get endpoint (success + 404 case)\n-tests/routes/things/delete.test.ts— Tests for delete endpoint (success + non-existent thing)\n\nCloses #1