Skip to content

add edit & delete post functionality with ownership checks#206

Open
GaneshKulakarni wants to merge 3 commits intoTiwariDivya25:mainfrom
GaneshKulakarni:main
Open

add edit & delete post functionality with ownership checks#206
GaneshKulakarni wants to merge 3 commits intoTiwariDivya25:mainfrom
GaneshKulakarni:main

Conversation

@GaneshKulakarni
Copy link
Contributor

📌 Description

This PR implements the ability for users to edit and delete their own posts after publishing.

It ensures that only the post owner can access edit/delete actions and also adds a confirmation popup before deletion. Additionally, edited posts now display an edited timestamp/label.


✅ Changes Implemented

  • Added Edit Post option (visible only to post owner)
  • Added Delete Post option (visible only to post owner)
  • Added confirmation modal before deleting a post
  • Added edited label/timestamp when a post is updated
  • Added backend permission checks to prevent unauthorized edit/delete access

🔐 Permission Handling

  • Frontend: Edit/Delete buttons appear only if post.userId === loggedInUserId
  • Backend: API validates ownership before updating/deleting

🛠️ Related Issue

Closes #23


🧪 Testing Done

  • ✅ Logged in user can edit their own post
  • ✅ Logged in user can delete their own post
  • ✅ Non-owner cannot see edit/delete buttons
  • ✅ Non-owner cannot edit/delete via API request
  • ✅ Confirmation modal appears before delete
  • ✅ Edited timestamp appears after update

📷 Screenshots :

Screenshot 2026-02-10 195903 Screenshot 2026-02-10 195853

📌 Checklist

  • Feature implemented according to acceptance criteria
  • Frontend and backend permission checks added
  • Confirmation modal added
  • Edited label/timestamp implemented
  • Code tested locally
  • No breaking changes introduced

@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for tiwaridivya25-devconnect ready!

Name Link
🔨 Latest commit 103d5ed
🔍 Latest deploy log https://app.netlify.com/projects/tiwaridivya25-devconnect/deploys/698b411d598aff000825e6c2
😎 Deploy Preview https://deploy-preview-206--tiwaridivya25-devconnect.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@vercel
Copy link

vercel bot commented Feb 10, 2026

@GaneshKulakarni is attempting to deploy a commit to the Divya Tiwari's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Add post editing and deletion functionality for users

1 participant