Skip to content

Add favourites API for authenticated users#49

Merged
andreagrandi merged 1 commit intomasterfrom
add-favourites-api
Apr 5, 2026
Merged

Add favourites API for authenticated users#49
andreagrandi merged 1 commit intomasterfrom
add-favourites-api

Conversation

@andreagrandi
Copy link
Copy Markdown
Owner

Summary

  • New Favourite model with unique constraint (user + library) and index for fast lookups
  • Three new API endpoints: POST /libraries/{slug}/favourite (mark), DELETE /libraries/{slug}/favourite (unmark), GET /libraries/favourites (paginated list)
  • Library detail, list, and latest endpoints now include is_favourited field via efficient Exists subquery annotation
  • Admin registration for the Favourite model
  • 27 new tests across 4 test classes, plus updates to 2 existing test files
  • API documentation, changelog (v1.8.0), and rate-limiting docs updated

Test plan

  • All 630 tests pass (nox -s tests)
  • Run E2E tests (nox -s e2e)
  • Manual curl: mark a library, list favourites, verify is_favourited on detail, unmark, confirm removal
  • Verify 401 for unauthenticated requests on all three new endpoints
  • Verify 404 when targeting pending/rejected libraries

Allow users to mark/unmark approved libraries as favourites and
retrieve a paginated list of their favourites. Library detail, list,
and latest endpoints now include an is_favourited field.
@andreagrandi andreagrandi merged commit 5301dc6 into master Apr 5, 2026
6 checks passed
@andreagrandi andreagrandi deleted the add-favourites-api branch April 5, 2026 08:28
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