From 7369d0bd6823dcc56298372bdfb38238535f1fe3 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 17 Nov 2018 14:34:39 +0000 Subject: [PATCH] hadpagsjiopafdouiaejwkewrran --- src/controllers/api/APIErrors.js | 2 +- src/controllers/api/noteResponse.js | 2 +- src/controllers/api/permaLinkResponse.js | 2 +- src/controllers/api/userResponses.js | 6 +++--- src/controllers/loginController.js | 2 +- src/controllers/status.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controllers/api/APIErrors.js b/src/controllers/api/APIErrors.js index d242bd1..f4a2f8e 100644 --- a/src/controllers/api/APIErrors.js +++ b/src/controllers/api/APIErrors.js @@ -30,6 +30,6 @@ export class APIErrors extends API { endpoint() { this.res .status(this.errors.status.code) - .end(JSON.stringify(this.errors, false, 4)); + .send(JSON.stringify(this.errors, false, 4)); } } diff --git a/src/controllers/api/noteResponse.js b/src/controllers/api/noteResponse.js index 2f4dbf0..0cf7538 100644 --- a/src/controllers/api/noteResponse.js +++ b/src/controllers/api/noteResponse.js @@ -31,6 +31,6 @@ export class NoteAPI extends API { endpoint() { this.res .status(201) - .end(JSON.stringify(this.response, false, 4)); + .send(JSON.stringify(this.response, false, 4)); } } diff --git a/src/controllers/api/permaLinkResponse.js b/src/controllers/api/permaLinkResponse.js index c3631fa..7fb7909 100644 --- a/src/controllers/api/permaLinkResponse.js +++ b/src/controllers/api/permaLinkResponse.js @@ -30,6 +30,6 @@ export class PermaLinkAPI extends API { endpoint() { this.res .status(201) - .end(JSON.stringify(this.response, false, 4)); + .send(JSON.stringify(this.response, false, 4)); } } diff --git a/src/controllers/api/userResponses.js b/src/controllers/api/userResponses.js index 99a7542..90d58e7 100644 --- a/src/controllers/api/userResponses.js +++ b/src/controllers/api/userResponses.js @@ -42,9 +42,9 @@ export class UserAPI extends API { } } - endpoint() { - this.res + async endpoint() { + await this.res .status(200) - .end(JSON.stringify(this.response, false, 4)); + .send(JSON.stringify(this.response, false, 4)); } } diff --git a/src/controllers/loginController.js b/src/controllers/loginController.js index a8aabcf..f57e703 100644 --- a/src/controllers/loginController.js +++ b/src/controllers/loginController.js @@ -51,7 +51,7 @@ export class LoginController extends ControllerHandler { } response.Token = token.token; - response.endpoint(); + await response.endpoint(); next(); } } diff --git a/src/controllers/status.js b/src/controllers/status.js index 2d39481..3b81bd5 100644 --- a/src/controllers/status.js +++ b/src/controllers/status.js @@ -1,6 +1,6 @@ export class StatusCodes { static pageNotFound(req, res, next) { - res.status(404).end('404 Page not found'); + res.status(404).send('404 Page not found'); next(); } }