Added tokeCommand delete endpoint and ajax call, replaced all raw error responses.

This commit is contained in:
rainbow napkin 2024-12-12 05:11:47 -05:00
parent af7f4219a5
commit 864304f13b
28 changed files with 93 additions and 64 deletions

View file

@ -225,8 +225,7 @@ channelSchema.statics.reqPermCheck = function(perm, chanField = "chanName"){
next();
}else{
//If not, prevent the request from going through and tell them why
res.status(401);
return res.send({errors:[{type: "Unauthorized", msg: "You do not have a high enough rank to access this resource.", date: new Date()}]});
return errorHandler(res, "You do not have a high enough rank to access this resource.", 'Unauthorized', 401);
}
});
});