Created channel perms schema and api routes.
This commit is contained in:
parent
9dbbc4e924
commit
8384e732f3
21 changed files with 250 additions and 20 deletions
|
|
@ -236,6 +236,23 @@ class canopyAjaxUtils{
|
|||
}
|
||||
}
|
||||
|
||||
async setChannelPermissions(chanName, permissionsMap){
|
||||
var response = await fetch(`/api/channel/permissions`,{
|
||||
method: "POST",
|
||||
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({chanName, channelPermissionsMap: Object.fromEntries(permissionsMap)})
|
||||
});
|
||||
|
||||
if(response.status == 200){
|
||||
return await response.json();
|
||||
}else{
|
||||
utils.ux.displayResponseError(await response.json());
|
||||
}
|
||||
}
|
||||
|
||||
async deleteChannel(chanName, confirm){
|
||||
var response = await fetch(`/api/channel/delete`,{
|
||||
method: "POST",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue