summaryrefslogtreecommitdiff
path: root/shop.fnl
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-10-13 23:10:38 +0600
committerunwox <me@unwox.com>2025-10-13 23:48:17 +0600
commit7f6c204322aa13dd8a9760b311955fc4b9a92637 (patch)
tree0c1d66d123398dacc0851b1c1589a7e3730761f5 /shop.fnl
parent5cf21fcb8c91896bb2b889dd4a90cc0b2ef3e9e5 (diff)
add simple filtering
Diffstat (limited to 'shop.fnl')
-rw-r--r--shop.fnl11
1 files changed, 10 insertions, 1 deletions
diff --git a/shop.fnl b/shop.fnl
index 9711095..24ff3d9 100644
--- a/shop.fnl
+++ b/shop.fnl
@@ -124,6 +124,14 @@
LIMIT 1"
[order-id product-name])))))
+(fn update-search-index [tx]
+ (_G.must
+ (luna.db.exec-tx tx "DELETE FROM products_search" []))
+ (_G.must
+ (luna.db.exec-tx tx "INSERT INTO products_search
+ SELECT title, short_description, name
+ FROM products;" [])))
+
{: create-order
: place-order
: finish-order
@@ -132,4 +140,5 @@
: create-order-line
: delete-order-line
: basket
- : in-basket?}
+ : in-basket?
+ : update-search-index}