acmucsd / membership-portal

REST API for the UC San Diego ACM chapter's membership portal.
https://members.acmucsd.com
Mozilla Public License 2.0
17 stars 5 forks source link

Ryan/update social routes improvement #422

Closed ryanDing26 closed 7 months ago

ryanDing26 commented 7 months ago

Info

Closes #411.

Description

What changes did you make? List all distinct problems that this PR addresses. Explain any relevant motivation or context.

Currently, the user social media api responses would take in each change for a user one-at-a-time rather than in a bundle, causing there to be multiple responses for one user's multiple updates to their social profiles.

The way that I interpreted this, for instance, was that if some user decided to add, say, their LinkedIn and Facebook to their social medias, two responses would be sent separately to insert a user's LinkedIn and Facebook rather than one response that could easily compile the two, cutting down on the number of function calls.

Changes

Type of Change

Testing

I have tested that my changes fully resolve the linked issue ...

WIP: Need to test changes/change tests such that more cases are checked. For instance, since these operations now take in arrays of changes, we would want it to test for a list of changes such that one is invalid, and have it not perform any changes at all (per clarification from Nikhil on how to handle errors in this sense). Additionally, one thing I still need to check is how the new return type for deleteSocialMediasForUser would affect the functionality (this type was changed as it now goes through all valid deletions and performs the deletion operation one-by-one in a loop, but that led to a change that needed to be made to the return type.

Checklist

WIP.

Screenshots

Please include a screenshot of your Postman testing passing successfully.

WIP

I should also note that I did accidentally work from changes that I performed from another issue that I had sent a PR for a bit ago (which I am working on fixing the nit), but I can resolve that on my end (PR was https://github.com/acmucsd/membership-portal/pull/407). Also, this PR right now still needs some work, but I pushed the changes to gauge some more feedback.

github-actions[bot] commented 7 months ago

Thanks for contributing! If you've made changes to the API's functionality, please make sure to bump the package version—see this guide to semantic versioning for details—and document those changes as appropriate.