HackYourFuture-CPH / simply-name.it

Final Project for Class17
MIT License
3 stars 1 forks source link

changed fetch method to add candidates #284

Closed NatsGt closed 2 years ago

NatsGt commented 2 years ago

Description

Replaced postData fetch method with global fetchFromDb

Fixes #282

How to test?

Add candidates on a board

Checklist

senner007 commented 2 years ago

We're using async almost everywhere now. I think it'd be better to standardize on that and remove the Promise resolution here. Also, any error will be caught at the error boundary anyway, right? Or do you want to catch it here?

Please note that using async/await syntax also returns Promise objects. The good thing about using async/await is that it is ubiquitous across languages even though the implementation underneath differs slightly.

NatsGt commented 2 years ago

Made a change to return data from fetch method since the response.json throws an error if the method is not get.