Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions client/src/api/UserApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,30 @@ class UserApiService {
const requestOptions = {
method: 'PATCH',
headers: this.headers,
body: JSON.stringify({ isActive })
body: JSON.stringify({ isActive }),
};

try {
return await fetch(url, requestOptions);
} catch (err) {
console.error('update is-active error', err);
alert('server not responding. Please try again.');
}
}

async updateUserDbEmail(userToEdit, email) {
const url = `${this.baseUserUrl}${userToEdit._id}`;
const lowercaseEmail = email.toLowerCase();
const requestOptions = {
method: 'PATCH',
headers: this.headers,
body: JSON.stringify({ lowercaseEmail }),
};

try {
return await fetch(url, requestOptions);
} catch (err) {
console.error('update is-active error', err)
console.error('update use email error', err);
alert('server not responding. Please try again.');
}
}
Expand Down