From 7f6c204322aa13dd8a9760b311955fc4b9a92637 Mon Sep 17 00:00:00 2001 From: unwox Date: Mon, 13 Oct 2025 23:10:38 +0600 Subject: add simple filtering --- shop.fnl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'shop.fnl') 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} -- cgit v1.2.3