This commit is contained in:
2020-04-09 10:31:15 +02:00
parent 7a9e12e62d
commit 999d493c68
4 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,5 @@
export default class Session {
public user_id: number;
public user_name: string;
public permissions: Array<string>;
public user_id?: number;
public user_name?: string;
public permissions?: Array<string>;
}

View File

@ -9,7 +9,7 @@ export default class Status {
return this._status;
}
public set status (value: number): void {
public set status (value: number) {
this._status = value;
}

View File

@ -1,4 +1,4 @@
import { Request, Response } from '@types/express';
import { Request, Response } from 'express';
import Status from './Status';
import Session from './Session';
@ -12,7 +12,7 @@ export default class Transaction {
public get req (): Request { return this._req; }
public get res (): Response { return this._res; }
public get status (): Status { return this._status; }
public session: Session;
public session?: Session;
/* constructor */
public constructor (req: Request, res: Response) {
@ -22,8 +22,8 @@ export default class Transaction {
}
/* methods */
public finalize (): void {
if (this._status.has_status ())
public finalize (data: any): void {
if (this._status.has_status)
this._res.status (this.status.status);
this._res.end (data);
}