summaryrefslogtreecommitdiff
path: root/shop.fnl
diff options
context:
space:
mode:
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}