Procházet zdrojové kódy

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

Book Pauk před 2 roky
rodič
revize
dd5598a695

+ 2 - 2
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);

+ 1 - 1
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;

+ 4 - 4
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);
     }

+ 1 - 1
server/core/DbSearcher.js

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

+ 2 - 2
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,