Поправка опечаток

This commit is contained in:
Book Pauk
2020-01-23 17:00:17 +07:00
parent 17670aabf9
commit 1d352a76ce
2 changed files with 5 additions and 5 deletions

View File

@@ -35,9 +35,9 @@ class ReaderController extends BaseController {
const request = req.body; const request = req.body;
let error = ''; let error = '';
try { try {
if (!request.action) if (!request.action)
throw new Error(`key 'action' is empty`); throw new Error(`key 'action' is empty`);
if (!request.items || Array.isArray(request.data)) if (!request.items || Array.isArray(request.data))
throw new Error(`key 'items' is empty`); throw new Error(`key 'items' is empty`);
return await this.readerStorage.doAction(request); return await this.readerStorage.doAction(request);

View File

@@ -150,11 +150,11 @@ class WebSocketController {
} }
async readerStorageDo(req, ws) { async readerStorageDo(req, ws) {
if (!req.body) if (!req.body)
throw new Error(`key 'body' is empty`); throw new Error(`key 'body' is empty`);
if (!req.body.action) if (!req.body.action)
throw new Error(`key 'action' is empty`); throw new Error(`key 'action' is empty`);
if (!req.body.items || Array.isArray(req.body.data)) if (!req.body.items || Array.isArray(req.body.data))
throw new Error(`key 'items' is empty`); throw new Error(`key 'items' is empty`);
this.send(await this.readerStorage.doAction(req.body), req, ws); this.send(await this.readerStorage.doAction(req.body), req, ws);