carlosvegap / capstone-kickoff

0 stars 0 forks source link

RefactorBack Adventurer Preferences Info #60

Closed CarLosVegga closed 1 year ago

CarLosVegga commented 1 year ago

Hi everyone!

Continuing with the refactoring:

I saw that there is this endpoint I used, where I pass an array of objectIds to my middleware, it goes to my database to fetch all information to afterwards get the information corresponding to those values.

I think that this implementation can work better. I did a FeedbackContext, so that I can store and call those values and simply filter the values that I want.

I feel so happy I was able to use (to the best of my knowledge) correctly a Promise.all. This PR is basically creating the endpoint, storing the data in a useContext, consuming it and solving some details like a request function that didn't include an async and even then it was working. I am curious if then it is not an async function. I was convinced it was because it should wait for the response.

Thanks for any comments! And sorry if there are being a lot of PR in such a small time window.