Добавлена заготовка для seriesSearch

This commit is contained in:
Book Pauk
2022-10-25 16:50:56 +07:00
parent 739f06226f
commit d770d499da
3 changed files with 103 additions and 0 deletions

View File

@@ -76,6 +76,8 @@ class WebSocketController {
await this.getWorkerState(req, ws); break;
case 'author-search':
await this.authorSearch(req, ws); break;
case 'series-search':
await this.seriesSearch(req, ws); break;
case 'get-author-book-list':
await this.getAuthorBookList(req, ws); break;
case 'get-series-book-list':
@@ -142,6 +144,15 @@ class WebSocketController {
this.send(result, req, ws);
}
async seriesSearch(req, ws) {
if (!req.query)
throw new Error(`query is empty`);
const result = await this.webWorker.seriesSearch(req.query);
this.send(result, req, ws);
}
async getAuthorBookList(req, ws) {
const result = await this.webWorker.getAuthorBookList(req.authorId);