Переименования
This commit is contained in:
@@ -202,8 +202,8 @@ class Api {
|
||||
}
|
||||
}
|
||||
|
||||
async search(query) {
|
||||
const response = await this.request({action: 'search', query});
|
||||
async authorSearch(query) {
|
||||
const response = await this.request({action: 'author-search', query});
|
||||
|
||||
if (response.error) {
|
||||
throw new Error(response.error);
|
||||
|
||||
@@ -289,7 +289,7 @@ class AuthorList extends BaseList {
|
||||
})();
|
||||
|
||||
try {
|
||||
const result = await this.api.search(query);
|
||||
const result = await this.api.authorSearch(query);
|
||||
|
||||
this.list.queryFound = result.author.length;
|
||||
this.list.totalFound = result.totalFound;
|
||||
|
||||
@@ -74,8 +74,8 @@ class WebSocketController {
|
||||
await this.getConfig(req, ws); break;
|
||||
case 'get-worker-state':
|
||||
await this.getWorkerState(req, ws); break;
|
||||
case 'search':
|
||||
await this.search(req, ws); break;
|
||||
case 'author-search':
|
||||
await this.authorSearch(req, ws); break;
|
||||
case 'get-book-list':
|
||||
await this.getBookList(req, ws); break;
|
||||
case 'get-series-book-list':
|
||||
@@ -133,11 +133,11 @@ class WebSocketController {
|
||||
this.send((state ? state : {}), req, ws);
|
||||
}
|
||||
|
||||
async search(req, ws) {
|
||||
async authorSearch(req, ws) {
|
||||
if (!req.query)
|
||||
throw new Error(`query is empty`);
|
||||
|
||||
const result = await this.webWorker.search(req.query);
|
||||
const result = await this.webWorker.authorSearch(req.query);
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ class DbSearcher {
|
||||
});
|
||||
}
|
||||
|
||||
async search(query) {
|
||||
async authorSearch(query) {
|
||||
if (this.closed)
|
||||
throw new Error('DbSearcher closed');
|
||||
|
||||
|
||||
@@ -245,11 +245,11 @@ class WebWorker {
|
||||
return db.wwCache.config;
|
||||
}
|
||||
|
||||
async search(query) {
|
||||
async authorSearch(query) {
|
||||
this.checkMyState();
|
||||
|
||||
const config = await this.dbConfig();
|
||||
const result = await this.dbSearcher.search(query);
|
||||
const result = await this.dbSearcher.authorSearch(query);
|
||||
|
||||
return {
|
||||
author: result.result,
|
||||
|
||||
Reference in New Issue
Block a user