fixed bug where res would time out

This commit is contained in:
plane000
2018-09-01 21:30:46 +01:00
parent 5f7313cd0d
commit 47a76e2f5b
7 changed files with 14 additions and 17 deletions

View File

@@ -1,9 +1,6 @@
import {API} from './API';
export class APIErrors extends API {
// get errors() {return this.errors}
// set errors(err) {this.errors = err}
constructor(res) {
super()
this.res = res;
@@ -25,7 +22,7 @@ export class APIErrors extends API {
this.errors.error.errors.push({status: statusCode, title: message, detail: verbose});
this.errors.status.code = statusCode;
this.errors.status.type = message;
this.errors.status.message = verbose;
this.errors.status.message = message;
}
count() { return this.errors.error.errors.length }

View File

@@ -3,7 +3,6 @@ import {API} from './API';
export class User extends API {
constructor(res, id, username, email, updated, token) {
super();
this.res = res;
this.response = {
status: {
error: false,
@@ -27,9 +26,6 @@ export class User extends API {
}
endpoint() {
this.res
.setHeader('Content-type', 'application/json')
.status(200)
.end(JSON.stringify(this.response, false, 4));
this.res.status(200).end(JSON.stringify(this.response, false, 4));
}
}