Change modify profile to take form data for PFP uploads #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Modified the changing a person's profile POST endpoint to take form data instead of a JSON body for image uploads.
Changes Made
Changed the UpdatePersonController to take in a profile_pic when initialized
Changed the
upload_profile_picfunction to take in form data to ping the upload serviceChanged the MeView class to parse form data
Test Coverage
Manually tested with Postman
Next Steps (delete if not applicable)
We probably need to change the logic on the upload profile picture function. Right now, we're making a lot of extra calls to the upload service because even if a user doesn't change their profile pic, we'll call the upload service with the same pic. Should probably check for whether the same pic is being uploaded or not before calling the upload service, but didn't make that change in this PR b/c we're pretty close to demo day