Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants