fixed bug where res would time out
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -66,6 +66,10 @@ export class UserTools extends BaseDatabase {
|
||||
let user = await User.findOne({where: {username: search}});
|
||||
if (user == null) return -1;
|
||||
return user;
|
||||
} else if (column == 'email') {
|
||||
let user = await User.findOne({where: {email: search}});
|
||||
if (user == null) return -1;
|
||||
return user;
|
||||
} else if (column == 'password') {
|
||||
let user = await User.findOne({where: {password: search}});
|
||||
if (user == null) return -1;
|
||||
|
||||
Reference in New Issue
Block a user