From 502edd8263764763f5611292802faf5d0f2b75fb Mon Sep 17 00:00:00 2001 From: Nikomiko Date: Fri, 30 Jan 2026 01:01:42 -0500 Subject: [PATCH] fix basic query --- apps/vdb-backend/src/index.ts | 11 ++++++++--- .../src/components/pages/KotobaPage.vue | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/apps/vdb-backend/src/index.ts b/apps/vdb-backend/src/index.ts index 6fa3ef6..beac03e 100644 --- a/apps/vdb-backend/src/index.ts +++ b/apps/vdb-backend/src/index.ts @@ -7,7 +7,7 @@ import fs from 'fs'; import { Lemma, WordForm, Lect } from "./db/dbmodel.js"; import "@total-typescript/ts-reset"; import { - Like + Like, In } from "typeorm"; const RELOAD_SHEET_ON_START = false; @@ -45,10 +45,15 @@ function initExpress() { const word_forms: WordForm[] = await WordForm.find({ where:{word_form: Like(`%${search_term}%`)}, - relations: { lemma: { word_forms: { lect: true }} } + relations: { lemma: true } }); - const lemmas = word_forms.map(w=>w.lemma); + let lemma_ids = word_forms.map(w=>w.lemma.lemma_name); + + const lemmas: Lemma[] = await Lemma.find({ + where: { lemma_name: In(lemma_ids)}, + relations: { word_forms: { lect: true }} + }) res.status(200).send({ terms: lemmas.length, diff --git a/apps/vdn-static/src/components/pages/KotobaPage.vue b/apps/vdn-static/src/components/pages/KotobaPage.vue index 0b8268b..35e3994 100644 --- a/apps/vdn-static/src/components/pages/KotobaPage.vue +++ b/apps/vdn-static/src/components/pages/KotobaPage.vue @@ -5,13 +5,23 @@
-

- ⚠ Under construction :3 ⚠ -

+
+

To searcn tropos-agnostically, enter a term below.

+
+ +
+ +
+ + +
+ +
+
-