Dashboard work and related
This commit is contained in:
parent
7bda2b1763
commit
b230a73a6f
44 changed files with 637 additions and 272 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue