From b4cb08ea625584ed5931c4d1285f86f7a3682978 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 30 Oct 2022 16:57:23 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=BC=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Search/AuthorList/AuthorList.vue | 4 ++-- server/core/DbSearcher.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index 620fcb1..7008e7b 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -104,10 +104,10 @@ -
+
diff --git a/server/core/DbSearcher.js b/server/core/DbSearcher.js index 4f64639..8c67fdc 100644 --- a/server/core/DbSearcher.js +++ b/server/core/DbSearcher.js @@ -464,6 +464,21 @@ class DbSearcher { where: `@@id(${db.esc(ids.slice(offset, offset + limit))})` }); + //для title восстановим books + if (from == 'title') { + const bookIds = found.map(r => r.id); + const rows = await this.restoreBooks(from, bookIds); + const rowsMap = new Map(); + for (const row of rows) + rowsMap.set(row.id, row); + + for (const f of found) { + const b = rowsMap.get(f.id); + if (b) + f.books = b.books; + } + } + return {found, totalFound}; } finally { this.searchFlag--;