feat: delete saved history posts#20
Conversation
|
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. |
|
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. |
|
Quick follow-up: this PR is still mergeable from GitHub's side and the linked issue |
|
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). |
Closes #10.
Summary
Adds deletion for individual saved history posts with server-side ownership enforcement.
Changes
deletePostById(userId, postId)using Supabasedelete().eq("user_id", userId).eq("id", postId)so users can only delete their own posts.DELETE /api/posts/[id]with Clerk auth and 404 handling when the post is not owned/found.Validation
node_modules/.bin/eslint components/history-content.tsx lib/services/postService.ts lib/services/postsApiService.ts app/api/posts/[id]/route.tsnode_modules/.bin/tsc --noEmitgit diff --checkSuggested labels for GSSoC:
gssoc:approved,level:intermediate,quality:clean,type:feature.