You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add project favorites: database table and API endpoints #30
Users should be able to favorite projects. This requires a new database table and API endpoints.
Database
New project_favorites table:
Column
Type
Description
user_id
text
FK to user (from auth provider)
project_id
UUID
FK to projects.id
created_at
timestamp
When favorited
PK
(user_id, project_id)
Composite primary key
API endpoints
POST /api/v1/projects/{projectId}/favorite — add to favorites (idempotent)
DELETE /api/v1/projects/{projectId}/favorite — remove from favorites
GET /api/v1/projects — include is_favorited: boolean in each project response item (for authenticated users)
Sorting
When returning project lists, favorited projects should sort to the top (within the existing sort order). Consider adding a sort query parameter or always sorting favorites first for authenticated users.
Activity