fix express response error
This commit is contained in:
parent
6a26f7b109
commit
4f47b343b9
|
@ -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> {
|
||||||
|
|
Loading…
Reference in New Issue