Finished up work on ignored users management popup in profile page
This commit is contained in:
parent
25a61b5809
commit
c2bbf0b6f8
8 changed files with 225 additions and 42 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue