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:
rainbow napkin 2024-12-30 09:43:25 -05:00
parent 4a865e8aa8
commit a51152a89d
14 changed files with 444 additions and 13 deletions

View file

@ -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`,{