-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
gssoc 25Contributing for UpdationContributing for Updationlabel 1Contributing for EasyContributing for Easy
Description
Hey @manishkumar8312
Description
The codebase contains an incomplete component, <HotelReg/>, which is currently unused and set to {false && <HotelReg/>} in App.jsx. This component provides the UI for a hotel owner to register a new hotel but lacks the necessary backend logic and integration.
This feature is a core part of the "Admin Functionality" mentioned in the README ("Add new hotel listings").
Proposed Plan to Complete the Feature
-
Create a Backend Endpoint:
- Design a
Hotelmodel in Mongoose. - Create a new API endpoint on the server, e.g.,
POST /api/hotels. - This endpoint must be a protected route that only users with the
'hotelOwner'role can access. It will receive hotel data from the form and save it to the database.
- Design a
-
Activate the Frontend Component:
- Wire up the
<HotelReg/>form'sonSubmithandler to make an authenticatedaxiosPOST request to the new/api/hotelsendpoint. - Implement state management for loading and error states during form submission.
- Provide user feedback upon success (e.g., "Hotel registered successfully!") or failure using a toast notification system.
- Wire up the
-
Integrate into the UI:
- Add a "Register Hotel" button to the Owner Dashboard (
/owner) that opens the<HotelReg/>component as a modal.
- Add a "Register Hotel" button to the Owner Dashboard (
Completing this feature is a major step towards fulfilling the project's core promise for hotel owners. I am prepared to work on both the frontend and backend parts of this task.
Metadata
Metadata
Assignees
Labels
gssoc 25Contributing for UpdationContributing for Updationlabel 1Contributing for EasyContributing for Easy