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

User Social Media Routes update social medias one at a time #411

Open dowhep opened 8 months ago

dowhep commented 8 months ago

Ideally, the POST, PATCH, and DELETE routes should take in an array of social medias as requests and perform actions on all of them.

However, the current implementation takes in exactly one social media at a time. When the user edits multiple social medias, the current implementation would send multiple requests, which is slow, costly, and prone to error.

dowhep commented 8 months ago

One potential thing to think about is that whether the route type should stay the same or not. Ex. Does adding a list of social media still count as a POST operation?

nik-dange commented 7 months ago

Yeah, a list of new social media URLs would be counted as a POST. An interesting case is if you add 2 new social media URLs, but you edit one other and remove yet another. In that case, I think it's up to the frontend to send the requests accordingly