Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature fetch bookings #15

Closed
1 task
HadikaMalik opened this issue Feb 24, 2024 · 1 comment
Closed
1 task

Feature fetch bookings #15

HadikaMalik opened this issue Feb 24, 2024 · 1 comment

Comments

@HadikaMalik
Copy link
Owner

HadikaMalik commented Feb 24, 2024

From React-Module-Project created by SallyMcGrath: CodeYourFuture#16

16. Load bookings remotely

Instructions:

Instead of getting the existing bookings from the file data/fakeBookings.json, we will get and load the bookings from a remote API. In the <Bookings /> component, use the React function useEffect to console.log() some text only when the page first renders on the screen. Verify that when you refresh the page, the text appears once in the console. Then, in the useEffect function, use the fetch() function to get data from https://cyf-hotel-api.netlify.app/.

Try to pair or mob on this feature.

Hints:

  • Replace FakeBookings in the bookings state and initialise it with [] (because we haven't fetched any results yet!)
  • After calling the fetch() function, use .then() to handle the response. Try looking at your Pokemon app that you worked on in class for an example
  • When the response comes back, use setBookings to update the results

Test:

  • Verify the customers data are still displayed correctly in the table.
@PERicci PERicci added the invalid This doesn't seem right label Mar 9, 2024
@HadikaMalik HadikaMalik moved this from 📋 Backlog to 🔖 Ready in React-Hotel-Website-Planner Mar 9, 2024
@BakhatBegum BakhatBegum moved this from 🔖 Ready to 📋 Backlog in React-Hotel-Website-Planner Mar 9, 2024
@PERicci PERicci removed the invalid This doesn't seem right label Mar 12, 2024
@PERicci PERicci moved this from 📋 Backlog to 🔖 Ready in React-Hotel-Website-Planner Mar 12, 2024
@PERicci PERicci assigned PERicci and unassigned PERicci Mar 12, 2024
@PERicci PERicci added the invalid This doesn't seem right label Mar 12, 2024
@PERicci PERicci moved this from 🔖 Ready to 📋 Backlog in React-Hotel-Website-Planner Mar 12, 2024
@PERicci PERicci removed the invalid This doesn't seem right label Mar 13, 2024
@PERicci PERicci moved this from 📋 Backlog to 🔖 Ready in React-Hotel-Website-Planner Mar 13, 2024
@PERicci PERicci self-assigned this Mar 14, 2024
@PERicci PERicci moved this from 🔖 Ready to 🏗 In progress in React-Hotel-Website-Planner Mar 14, 2024
@PERicci
Copy link
Collaborator

PERicci commented Mar 14, 2024

#53

@PERicci PERicci moved this from 🏗 In progress to 👀 In review in React-Hotel-Website-Planner Mar 14, 2024
@PERicci PERicci moved this from 👀 In review to ✅ Done in React-Hotel-Website-Planner Mar 16, 2024
@PERicci PERicci closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants