Переименования

This commit is contained in:
Book Pauk
2022-10-25 15:43:40 +07:00
parent 7553b88b89
commit dd5598a695
5 changed files with 10 additions and 10 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -345,7 +345,7 @@ class DbSearcher {
});
}
async search(query) {
async authorSearch(query) {
if (this.closed)
throw new Error('DbSearcher closed');

View File

@@ -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,