Skip to content
Snippets Groups Projects
Commit eeb177dc authored by michael.minelli's avatar michael.minelli
Browse files

Session => Add possibility to send en personal code into the data of the response

parent ffe68c19
No related branches found
No related tags found
No related merge requests found
......@@ -68,9 +68,9 @@ class Session {
Send a response to the client
Information: Data could be a promise or an object. If it's a promise, we wait on the data to be resolved before sending the response
*/
sendResponse(res: express.Response, code: number, data?: any, descriptionOverride?: string) {
sendResponse(res: express.Response, code: number, data?: any, descriptionOverride?: string, internalCode?: number) {
Promise.resolve(data).then((toReturn: any) => {
this.getResponse(code, toReturn, descriptionOverride).then(response => {
this.getResponse(internalCode ?? code, toReturn, descriptionOverride).then(response => {
res.status(code).json(response);
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment