dwyl / library

The embryonic iteration of dwyl's library app
https://dwyl-library.herokuapp.com/
15 stars 1 forks source link

Use AJAX for adding books to library #16

Open ZooeyMiller opened 6 years ago

ZooeyMiller commented 6 years ago

At the moment we have a standard route for when one adds a book to the database (using a querystring and a get request), this involves a page refresh which means that the user loses all of the search items on the page.

For users without javascript enabled, we would have the page the user is on (with the querystring for their search on the url we send to the server as a parameter), so that once the book is added the user will be redirected back to their previous search. This involves a page reload, and hitting the Google Books API (which is relatively strictly rate limited) again. This isn't ideal, but would be a reasonable compromise for users without JS enabled.

For users with JS enabled we would like to make an API route on our server where we can use AJAX on the front end to update the database, thus not needing a page refresh.

iteles commented 6 years ago

Agreed this is a lower priority enhancement, thanks for capturing this whilst it's top of mind @ZooeyMiller 👍