3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

Dashboard work and related

This commit is contained in:
Dragory 2019-06-23 19:18:41 +03:00
parent 7bda2b1763
commit b230a73a6f
44 changed files with 637 additions and 272 deletions

View file

@ -4,8 +4,20 @@ export function unauthorized(res: Response) {
res.status(403).json({ error: "Unauthorized" });
}
export function error(res: Response, message: string, statusCode: number = 500) {
res.status(statusCode).json({ error: message });
}
export function serverError(res: Response, message: string) {
error(res, message, 500);
}
export function clientError(res: Response, message: string) {
res.status(400).json({ error: message });
error(res, message, 400);
}
export function notFound(res: Response) {
res.status(404).json({ error: "Not found" });
}
export function ok(res: Response) {