Finished up with email change backend. Just need to make a prompt on the profile page for our AJAX call.
This commit is contained in:
parent
4a865e8aa8
commit
a51152a89d
14 changed files with 444 additions and 13 deletions
|
|
@ -534,6 +534,25 @@ class canopyAjaxUtils{
|
|||
}
|
||||
}
|
||||
|
||||
async requestEmailChange(email, pass){
|
||||
const response = await fetch(`/api/account/emailChangeRequest`,{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"x-csrf-token": utils.ajax.getCSRFToken()
|
||||
},
|
||||
body: JSON.stringify({email, pass})
|
||||
});
|
||||
|
||||
//If we received a successful response
|
||||
if(response.status == 200){
|
||||
const popup = new canopyUXUtils.popup("A confirmation link has been sent to the new email address.");
|
||||
//Otherwise
|
||||
}else{
|
||||
utils.ux.displayResponseError(await response.json());
|
||||
}
|
||||
}
|
||||
|
||||
//Channel
|
||||
async newChannel(name, description, thumbnail, verification){
|
||||
var response = await fetch(`/api/channel/register`,{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue