diff --git a/client/components/Api/Api.vue b/client/components/Api/Api.vue index 38edf02..551dec6 100644 --- a/client/components/Api/Api.vue +++ b/client/components/Api/Api.vue @@ -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); diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index b79b377..a5a5e2d 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -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; diff --git a/server/controllers/WebSocketController.js b/server/controllers/WebSocketController.js index 5b89d7e..903dfb5 100644 --- a/server/controllers/WebSocketController.js +++ b/server/controllers/WebSocketController.js @@ -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); } diff --git a/server/core/DbSearcher.js b/server/core/DbSearcher.js index 375e2c0..a35bb55 100644 --- a/server/core/DbSearcher.js +++ b/server/core/DbSearcher.js @@ -345,7 +345,7 @@ class DbSearcher { }); } - async search(query) { + async authorSearch(query) { if (this.closed) throw new Error('DbSearcher closed'); diff --git a/server/core/WebWorker.js b/server/core/WebWorker.js index 8591b7f..0349dad 100644 --- a/server/core/WebWorker.js +++ b/server/core/WebWorker.js @@ -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,