Server Request and UI Optimization
Budget: $10 – $30 USD
You should send requests to the server when you like or dislike cards.
You should send a request to the server when you add a new card
You should send a request to the server when you delete a card
When I add or like cards, there are errors https://snipboard.io/mePo4E.jpg
I've noticed other mistakes:
Please, make the confirmation modal match the design
Please, make the modal match the mobile design on 320px https://snipboard.io/Z0TsRH.jpg . It should be wider than the cards, but should not stick to the sides of the screen
The code of ok checking is repeated in every request of the project. To avoid it you need to make a special method _checkResponse that will check any response from the server if it’s ok or not.
You don't need to store the cards inside localStorage. Everything should be only via the server
It’s better to find constant DOM elements only 1 time at the top of the file so as not to waste resources on searching them again and again when you call a method (function) because searching is a very hard operation for the browser engine
Please, delete the old unused code to clean up the project. It's misleading
You need to only return the default button text in the finally block, so that the button could get the text regardless of whether the request succeeds or fails.
Please, reuse openModal for any opening to avoid code duplication
You should send a request to the server when you add a new card
You should send a request to the server when you delete a card
When I add or like cards, there are errors https://snipboard.io/mePo4E.jpg
I've noticed other mistakes:
Please, make the confirmation modal match the design
Please, make the modal match the mobile design on 320px https://snipboard.io/Z0TsRH.jpg . It should be wider than the cards, but should not stick to the sides of the screen
The code of ok checking is repeated in every request of the project. To avoid it you need to make a special method _checkResponse that will check any response from the server if it’s ok or not.
You don't need to store the cards inside localStorage. Everything should be only via the server
It’s better to find constant DOM elements only 1 time at the top of the file so as not to waste resources on searching them again and again when you call a method (function) because searching is a very hard operation for the browser engine
Please, delete the old unused code to clean up the project. It's misleading
You need to only return the default button text in the finally block, so that the button could get the text regardless of whether the request succeeds or fails.
Please, reuse openModal for any opening to avoid code duplication