Finished up work on ignored users management popup in profile page

This commit is contained in:
rainbow napkin 2026-11-08 23:01:02 -05:00
parent 25a61b5809
commit c2bbf0b6f8
8 changed files with 225 additions and 42 deletions

View file

@ -885,6 +885,52 @@ class canopyAjaxUtils{
}
}
async getIgnoredUsers(){
var response = await fetch(`/api/account/ignore`,{
method: "GET"
});
if(response.ok){
return (await response.json())
}else{
utils.ux.displayResponseError(await response.json());
}
}
async ignoreUser(user){
const response = await fetch(`/api/account/ignore`,{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-csrf-token": utils.ajax.getCSRFToken()
},
body: JSON.stringify({user})
});
if(response.ok){
return (await response.json())
}else{
utils.ux.displayResponseError(await response.json());
}
}
async unignoreUser(user){
const response = await fetch(`/api/account/unignore`,{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-csrf-token": utils.ajax.getCSRFToken()
},
body: JSON.stringify({user})
});
if(response.ok){
return (await response.json())
}else{
utils.ux.displayResponseError(await response.json());
}
}
async deleteAccount(pass){
const response = await fetch(`/api/account/delete`,{
method: "POST",