swarooppatilx / scruter

Scruter is a local classifieds and community site designed to bring people together for buying, selling, and exchanging goods and services.
https://scruter.vercel.app
GNU General Public License v3.0
28 stars 135 forks source link

Add Listing Modification Page to Dashboard for Sellers #469

Closed ShivanshPlays closed 2 weeks ago

ShivanshPlays commented 2 weeks ago

Overview

This PR introduces a dedicated page on the dashboard for users to modify their existing listing details. Users can update various attributes of their listings, including the name, price, description, category, and images. This page enhances the user experience by offering a straightforward interface for managing listings.

Changes Made:

  1. User Interface:

    • Added a user-friendly form to the dashboard for modifying listing details.
    • Included fields for modifying name, price, description, category, and images.
    • Implemented an image upload component allowing users to add or remove images.
  2. Functionality:

    • Fetches the current listing details from the database on page load.
    • Provides form validation to ensure all fields are filled before submission.
    • Displays success or error messages after submitting the form based on the operation result.
  3. Routing and Navigation:

    • Added routing for the new page accessible from the dashboard.
    • Added a button to navigate back to the listings overview page after modifications.
  4. Backend Integration:

    • Updated the updateListing server actions to accomodate some necessary changes needed. Images were duplicating on updating.
    • Ensured that only authenticated users can modify their listings.

Screenshots

https://github.com/user-attachments/assets/1c9073ab-ffd9-4d28-b85f-0619b7879bb0

closes #440

vercel[bot] commented 2 weeks ago

@ShivanshPlays is attempting to deploy a commit to the Piyush's projects Team on Vercel.

A member of the Team first needs to authorize it.