Решение проблемы скачивания файлов в режиме "Удаленная библиотека"

(запрашивался не тот файл из-за несовпадения bookId)
This commit is contained in:
Book Pauk
2022-11-13 01:59:42 +07:00
parent 4d3661b758
commit 2db2b8cff4
8 changed files with 43 additions and 26 deletions

View File

@@ -165,19 +165,19 @@ class WebSocketController {
}
async getBookLink(req, ws) {
if (!utils.hasProp(req, 'bookId'))
throw new Error(`bookId is empty`);
if (!utils.hasProp(req, 'bookUid'))
throw new Error(`bookUid is empty`);
const result = await this.webWorker.getBookLink(req.bookId);
const result = await this.webWorker.getBookLink(req.bookUid);
this.send(result, req, ws);
}
async getBookInfo(req, ws) {
if (!utils.hasProp(req, 'bookId'))
throw new Error(`bookId is empty`);
if (!utils.hasProp(req, 'bookUid'))
throw new Error(`bookUid is empty`);
const result = await this.webWorker.getBookInfo(req.bookId);
const result = await this.webWorker.getBookInfo(req.bookUid);
this.send(result, req, ws);
}