Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 981 Bytes

File metadata and controls

25 lines (17 loc) · 981 Bytes

🧾 PRD: Fetch & Delete Hotels via Frontend

🎯 Objective

To display all hotels fetched from the backend and enable users to delete any hotel directly from the frontend using integrated APIs.

⚙️ Scope

Use a custom React hook useFetch.jsx to fetch hotel data from /api/hotels. Each displayed hotel will include a Delete button that sends a DELETE request to /api/hotels/:id, removing the hotel from the database and updating the UI list.

🧩 Features

  • Fetch and render all hotels dynamically using reusable hook.
  • Delete selected hotel and refresh the hotel list instantly.
  • Show success message upon successful deletion.
  • Handle loading and error states gracefully.

🌱 Key Learnings

  • Implementation of DELETE method integration with backend APIs.
  • Efficient state update post-deletion in React.
  • Improved understanding of frontend-backend CRUD synchronization.

Backend

Connect