dashboard: auth fixes, guild listing, config editing

This commit is contained in:
Dragory 2019-06-23 03:40:53 +03:00
parent 1dae3019c4
commit 7bda2b1763
14 changed files with 200 additions and 42 deletions

13
src/api/responses.ts Normal file
View file

@ -0,0 +1,13 @@
import { Response } from "express";
export function unauthorized(res: Response) {
res.status(403).json({ error: "Unauthorized" });
}
export function clientError(res: Response, message: string) {
res.status(400).json({ error: message });
}
export function ok(res: Response) {
res.json({ result: "ok" });
}