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

Fetch restaurants in new frontend #23

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Fetch restaurants in new frontend #23

merged 2 commits into from
Sep 5, 2023

Conversation

sergiosja
Copy link
Collaborator

What has been done

  • Created hook useRestaurants to fetch restaurants from backend
  • Used the hook in src/Admin/scenarios/Restaurants/index.tsx to fetch dynamically instead of hardcoding

Testing

Tested with docker

To run code

  • Spin up containers
  • Log in to new frontend on localhost:4000/admin

If you have not registered restaurants, it will display "No restaurants found.", else it will list your restaurants. Restaurants must still be added in the old frontend, on localhost:4434

Copy link

@annabjorgo annabjorgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work, just added one feedback comment!!I still can't run this on my computer, so I haven't tested it out yet. will do soon :D

Copy link

@stianjsu stianjsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Er enig med Anna sin kommentar. All errorhandlingen gir litt redundant bruk av CardComponent, men kommer ikke på noen god måte å generalisere det på rn

@annabjorgo annabjorgo self-requested a review September 5, 2023 07:41
@sergiosja sergiosja merged commit 8b21b09 into main Sep 5, 2023
@sergiosja sergiosja deleted the restaurants-fetching branch September 5, 2023 08:50
annabjorgo pushed a commit that referenced this pull request Sep 18, 2023
* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* chore: changes to console.error and removes throw

Fetch restaurants in new frontend (#23)

* created hook for fetching restaurants

* moved every check to a big ternary

Bugfix lmdb installation (#25)

* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* Bugfix; lmdb return value

* Bugfix; None value check

---------

Co-authored-by: stianjsu <stianjsu@gmail.com>

Mutation reqs (#26)

* Demo for post reqs

* PB-30B: Layout for mutation + toggle active status

* PB-30B: Linter happy?

* PB-30B: prøver på nytt

* PB-30b: some refactoring + support for post and delete

* PB-30b: more refactoring

* PB-30b: refatoring

* PB-30b: typo

create hook for events called useEvents

wip: proposed solution to post events with helper functions

wip: useEvents and posting events

add useEVent in CreateEventCard components

create hook for events called useEvents

wip: useEvents and posting events

add useEVent in CreateEventCard components

small typos

implement events with restaurants

posting and displaying  events now working
annabjorgo pushed a commit that referenced this pull request Sep 19, 2023
* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* chore: changes to console.error and removes throw

Fetch restaurants in new frontend (#23)

* created hook for fetching restaurants

* moved every check to a big ternary

Bugfix lmdb installation (#25)

* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* Bugfix; lmdb return value

* Bugfix; None value check

---------

Co-authored-by: stianjsu <stianjsu@gmail.com>

Mutation reqs (#26)

* Demo for post reqs

* PB-30B: Layout for mutation + toggle active status

* PB-30B: Linter happy?

* PB-30B: prøver på nytt

* PB-30b: some refactoring + support for post and delete

* PB-30b: more refactoring

* PB-30b: refatoring

* PB-30b: typo

create hook for events called useEvents

wip: proposed solution to post events with helper functions

wip: useEvents and posting events

add useEVent in CreateEventCard components

create hook for events called useEvents

wip: useEvents and posting events

add useEVent in CreateEventCard components

small typos

implement events with restaurants

posting and displaying  events now working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants