From 17f6216e675a54ef1163fe81dfe1b2142d8674af Mon Sep 17 00:00:00 2001 From: Sheldon Cooper Date: Thu, 16 Jul 2026 17:43:18 -0400 Subject: [PATCH] (wip) - stuff --- apps/ktb-static/script.js | 15 ++-- apps/ktb-static/search.html | 114 +++++++++++++++++++---------- apps/ktb-static/styles.css | 92 +++++++++++++++++++++-- apps/vdb-backend/src/db/dbmodel.ts | 2 +- apps/vdb-backend/src/index.ts | 9 ++- 5 files changed, 180 insertions(+), 52 deletions(-) diff --git a/apps/ktb-static/script.js b/apps/ktb-static/script.js index 672ec95..e1f41db 100644 --- a/apps/ktb-static/script.js +++ b/apps/ktb-static/script.js @@ -70,19 +70,19 @@ document.addEventListener("alpine:init", () => { } catch (e) { console.error(e); } }, - async postDefinition(definition_text, lemma_name) { + async postDefinition(definition_id, definition_text, lemma_name) { try { const res = await axios.put('http://localhost:1225/definition', { - definition_text, lemma_name + definition_id, definition_text, lemma_name }); return res.data.lemma_detail; } catch (e) { console.error(e); } }, - async postExample(example_text, lemma_name) { + async postExample(example_id, example_text, lemma_name) { try { const res = await axios.put('http://localhost:1225/example', { - example_text, lemma_name + example_id, example_text, lemma_name }); return res.data.lemma_detail; } catch (e) { console.error(e); } @@ -90,8 +90,11 @@ document.addEventListener("alpine:init", () => { filterResults(searchTerm) { if (!searchTerm) return this.search_results.results; - return this.search_results.results.filter(item => - item.lemma_name.toLowerCase().includes(searchTerm.toLowerCase()) + return this.search_results.results + .filter( //item.lemma_name.toLowerCase().includes(searchTerm.toLowerCase()) + item => item.word_forms + .map(wf => wf.word_form.toLowerCase()) + .join().includes(searchTerm.toLowerCase()) ); } }); diff --git a/apps/ktb-static/search.html b/apps/ktb-static/search.html index 51d0d27..256d026 100644 --- a/apps/ktb-static/search.html +++ b/apps/ktb-static/search.html @@ -19,10 +19,11 @@ @alpine:init="$store.dictionary.loadPreferences()">