Skip to content

Add Favorite Snippets API with pagination#118

Open
dedukpe wants to merge 1 commit into
SudiptaPaul-31:mainfrom
dedukpe:feat/favorite-snippets-api
Open

Add Favorite Snippets API with pagination#118
dedukpe wants to merge 1 commit into
SudiptaPaul-31:mainfrom
dedukpe:feat/favorite-snippets-api

Conversation

@dedukpe

@dedukpe dedukpe commented Jun 27, 2026

Copy link
Copy Markdown

Closes #103

Summary:
Adds a Favorite Snippets API allowing users to manage their favorite code snippets.

Changes:

Database:

  • Added favorites relationship table
  • Added userId + snippetId indexing
  • Added duplicate prevention constraint

API:

Added endpoints:

POST /api/favorites/:snippetId

  • Add snippet to favorites

DELETE /api/favorites/:snippetId

  • Remove snippet from favorites

GET /api/favorites

  • Fetch paginated favorite snippets

Features:

  • Authentication-protected routes
  • Request validation
  • Consistent API response format
  • Pagination support
  • Efficient database querying

Tests:

Added coverage for:

  • Adding favorites
  • Duplicate prevention
  • Removing favorites
  • Fetching paginated favorites
  • Validation and auth errors

Documentation:

  • Added frontend API usage documentation

Validation:

  • Tests passing
  • No existing functionality affected

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@dedukpe is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@dedukpe Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Favorite Snippets API

1 participant