Skip to content

Feat: Complete and Integrate the 'Register Your Hotel' Feature #17

@Git-brintsi20

Description

@Git-brintsi20

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

  1. Create a Backend Endpoint:

    • Design a Hotel model 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.
  2. Activate the Frontend Component:

    • Wire up the <HotelReg/> form's onSubmit handler to make an authenticated axios POST request to the new /api/hotels endpoint.
    • 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.
  3. Integrate into the UI:

    • Add a "Register Hotel" button to the Owner Dashboard (/owner) that opens the <HotelReg/> component as a modal.

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

Labels

gssoc 25Contributing for Updationlabel 1Contributing for Easy

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions