1
0
Fork 0

fix express response error

This commit is contained in:
Sean Sube 2023-01-02 20:39:30 -06:00
parent 6a26f7b109
commit 4f47b343b9
1 changed files with 1 additions and 2 deletions

View File

@ -10,13 +10,12 @@ export const STATUS_ALLOWED = 200;
export const STATUS_DENIED = 403; export const STATUS_DENIED = 403;
export function sendLocks(res: Response, locks: Array<LockData>, allow: boolean): void { export function sendLocks(res: Response, locks: Array<LockData>, allow: boolean): void {
res.json({ locks });
if (allow) { if (allow) {
res.status(STATUS_ALLOWED); res.status(STATUS_ALLOWED);
} else { } else {
res.status(STATUS_DENIED); res.status(STATUS_DENIED);
} }
res.send(); res.json({ locks });
} }
export async function expressIndex(context: ServerContext, app: Express, req: Request, res: Response): Promise<void> { export async function expressIndex(context: ServerContext, app: Express, req: Request, res: Response): Promise<void> {