Anshul439 / Blogverse

A MERN stack Blog App
https://blogverse-l4af.onrender.com
4 stars 5 forks source link

Error on Editing Blog Post: Missing Post ID Leads to Update Failure #12

Open VanshChitransh opened 2 hours ago

VanshChitransh commented 2 hours ago

Issue: Unable to Edit Blog Post - Missing Post ID

Description:

After publishing a blog post, users are unable to edit the post. The update process fails, and the following error is observed:

This error indicates that the _id of the post is not properly passed in the PUT request to update the post.

Steps to Reproduce:

  1. Write and publish a blog post.
  2. Attempt to edit the published post using the "Update Post" feature.
  3. Observe the failed PUT request and error in the console.

Error Logs:

Screenshot from 2024-10-04 01-24-15

Impact:

Possible Cause:

Proposed Solution:

  1. Frontend Fix:

    • Ensure the correct _id of the post is passed when initiating the PUT request.
    • Check that the component responsible for post updates retrieves and maintains the post ID properly during the edit process.
  2. Backend Validation:

    • Add validation in the backend to check if the _id is present in the request. Return an appropriate error message if the _id is missing.

Priority:

High

Status:

Open

VanshChitransh commented 2 hours ago

@Anshul439 I would love to work on this issue.