Skip to content

feat: delete saved history posts#20

Open
saurabhhhcodes wants to merge 1 commit into
notsoocool:mainfrom
saurabhhhcodes:feat/delete-history-post-10
Open

feat: delete saved history posts#20
saurabhhhcodes wants to merge 1 commit into
notsoocool:mainfrom
saurabhhhcodes:feat/delete-history-post-10

Conversation

@saurabhhhcodes
Copy link
Copy Markdown

Closes #10.

Summary

Adds deletion for individual saved history posts with server-side ownership enforcement.

Changes

  • Added deletePostById(userId, postId) using Supabase delete().eq("user_id", userId).eq("id", postId) so users can only delete their own posts.
  • Exposed DELETE /api/posts/[id] with Clerk auth and 404 handling when the post is not owned/found.
  • Added a History delete action with confirmation, loading state, local list update, and error/success toasts.

Validation

  • node_modules/.bin/eslint components/history-content.tsx lib/services/postService.ts lib/services/postsApiService.ts app/api/posts/[id]/route.ts
  • node_modules/.bin/tsc --noEmit
  • git diff --check

Suggested labels for GSSoC: gssoc:approved, level:intermediate, quality:clean, type:feature.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

Someone is attempting to deploy a commit to the notsoocool's projects Team on Vercel.

A member of the Team first needs to authorize it.

@saurabhhhcodes
Copy link
Copy Markdown
Author

Quick validation note for review: this PR is mergeable from GitHub's side. The only visible red status is Vercel team authorization, which I cannot approve from my fork. The change is scoped to deleting saved history posts across the API/service/UI path. If accepted for GSSoC, please add the suitable scoring labels as applicable.

@saurabhhhcodes
Copy link
Copy Markdown
Author

Quick follow-up: this PR is still mergeable from GitHub's side and the linked issue #10 already carries gssoc:approved plus level:intermediate. If there are no remaining changes needed, please review and merge when convenient.

@saurabhhhcodes
Copy link
Copy Markdown
Author

Revalidated this branch locally just now: ESLint and TypeScript checks are clean, and the delete flow still matches the issue scope (scoped DELETE API, confirmation, toast feedback, and immediate UI removal).

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.

feat: Delete individual posts from History

1 participant