TempleOfArtemis / FEC_main

0 stars 4 forks source link

Refactoring Server Call Return #96

Open SoniaAnn opened 2 years ago

SoniaAnn commented 2 years ago

Hey @benjaminlthornton, great work again! One last mention on server calls

Description

I notice that your get request functions pass the entire response object to the component that invokes it. I think it could be cleaner to return only the data portion of the response object to your client/component files. That way you don't have an extra layer of property lookup (i.e. res.data.prop vs. data.prop) and you're omitting a huge amount of data from being passed around (that response object can be so huge!)

Tasks/ Suggestions

Files

https://github.com/TempleOfArtemis/FEC_main/blob/67594d27c07f8b71da1971274616fd34cd304bee/client/src/Ratings-Reviews/RRcomponents/ReviewList/serverAction.jsx#L3-L11

**Again, great work Ben!