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

Show proper message if api request is forbidden (403 status) #6

Open
devfake opened this issue Aug 18, 2018 · 1 comment
Open

Show proper message if api request is forbidden (403 status) #6

devfake opened this issue Aug 18, 2018 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@devfake
Copy link
Owner

devfake commented Aug 18, 2018

It could be the case, that the API volume of Google Books is exhausted. The response will return a 403 status code.

I updated the backend and return this status to the client (0d65914).

What we need now is to display a message in the frontend. The best thing we can do is create a new variable, and set it to true if the response is a 403. And show a proper message in the template, similiar to the Nothing found :( span.

To test this, you can replace the line 24 in express.js instead of res.json(formattedData) with res.json(forbiddenResponse()).

Bonus point: Move the hardcodet status codes (404 for example) to own constants on top of the script (:

@devfake devfake added bug Something isn't working good first issue Good for newcomers labels Aug 18, 2018
@ccmetz
Copy link

ccmetz commented Oct 1, 2018

Hey I would love to work on this issue! Could you assign me to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants