runtime-errors-unihack / timable

"Unity Rising" track-winning project @ Unihack 5 (2023). A community-based accessibility mapping platform for Timisoara, for rating & flagging places based on their accessibility.
0 stars 0 forks source link

Add endpoints for `votes` #3

Closed serbanlex closed 11 months ago

serbanlex commented 11 months ago
  1. GET /vote/{id} -> gets a vote from the Vote table, querying by id
  2. POST /vote -> uses a Pydantic model, VoteModel, that should match everything from the DB model besides the ID (which will be autoincremented anyway)
  3. PATCH /vote/{id} -> this should only modify the positive: bool attribute, use a query param for this (something like positive
  4. DELETE /vote/{id} -> deletes the vote by ID, with appropriate checks that it exists.

Consider refactoring the common code to the service package, in a votes.py file.