Added tokeCommand delete endpoint and ajax call, replaced all raw error responses.
This commit is contained in:
parent
af7f4219a5
commit
864304f13b
28 changed files with 93 additions and 64 deletions
|
|
@ -198,6 +198,23 @@ class canopyAdminUtils{
|
|||
utils.ux.displayResponseError(await response.json());
|
||||
}
|
||||
}
|
||||
|
||||
async deleteTokeCommand(command){
|
||||
var response = await fetch(`/api/admin/tokeCommands`,{
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
//Unfortunately JSON doesn't natively handle ES6 maps, and god forbid someone update the standard in a way that's backwards compatible...
|
||||
body: JSON.stringify({command})
|
||||
});
|
||||
|
||||
if(response.status == 200){
|
||||
return await response.json();
|
||||
}else{
|
||||
utils.ux.displayResponseError(await response.json());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class adminUserList{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue