Upgraded typescript and tslint version and fixed query type error.

This commit is contained in:
softsimon 2020-07-24 19:38:39 +07:00
parent adcec33fb9
commit fa88bd7057
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 1271 additions and 8 deletions

1262
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@
"@types/express": "^4.17.2", "@types/express": "^4.17.2",
"@types/request": "^2.48.2", "@types/request": "^2.48.2",
"@types/ws": "^6.0.4", "@types/ws": "^6.0.4",
"tslint": "^5.11.0", "tslint": "~6.1.0",
"typescript": "^3.6.4" "typescript": "~3.9.7"
} }
} }

View File

@ -109,16 +109,17 @@ class Routes {
public getBisqTransactions(req: Request, res: Response) { public getBisqTransactions(req: Request, res: Response) {
const types: string[] = []; const types: string[] = [];
if (req.query.types && !Array.isArray(req.query.types)) { req.query.types = req.query.types || [];
if (!Array.isArray(req.query.types)) {
res.status(500).send('Types is not an array'); res.status(500).send('Types is not an array');
return; return;
} else { }
for (const _type in req.query.types) { for (const _type in req.query.types) {
if (typeof req.query.types[_type] === 'string') { if (typeof req.query.types[_type] === 'string') {
types.push(req.query.types[_type].toString()); types.push(req.query.types[_type].toString());
} }
} }
}
const index = parseInt(req.params.index, 10) || 0; const index = parseInt(req.params.index, 10) || 0;
const length = parseInt(req.params.length, 10) > 100 ? 100 : parseInt(req.params.length, 10) || 25; const length = parseInt(req.params.length, 10) > 100 ? 100 : parseInt(req.params.length, 10) || 25;