mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 13:15:05 +00:00
Merge pull request #35 from ClaytonWWilson/edit-profile-fix
Fixing editProfile bugs and making the database storage more efficient
This commit is contained in:
@@ -88,6 +88,14 @@ export class edit extends Component {
|
||||
handle: this.state.handle,
|
||||
bio: this.state.bio
|
||||
};
|
||||
|
||||
// Removes all keys from newProfileData that are empty, undefined, or null
|
||||
Object.keys(newProfileData).forEach(key => {
|
||||
if (newProfileData[key] === "" || newProfileData[key] === undefined || newProfileData[key] === null) {
|
||||
delete newProfileData[key];
|
||||
}
|
||||
})
|
||||
|
||||
axios
|
||||
.post("/updateProfileInfo", newProfileData)
|
||||
.then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user