Add article.listSearchIndex for client-side search preload

Returns all company articles with id, sku, name, and eans as a flat
array. Walks the category tree to find reachable articles. Single
query using recursive CTE + FOR JSON for eans.
This commit is contained in:
seb
2026-08-03 22:31:36 +02:00
parent eaf4df4f5a
commit 84bb561031
4 changed files with 70 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import articleOrderImages from './store/article/orderImages.js';
import articleAddImage from './store/article/addImage.js';
import articleCreateUnderParent from './store/article/createUnderParent.js';
import articleGetBySku from './store/article/getBySku.js';
import articleListSearchIndex from './store/article/listSearchIndex.js';
import articleUpdateBySku from './store/article/updateBySku.js';
import articleSetPricesBySku from './store/article/setPricesBySku.js';
import articleSetEansBySku from './store/article/setEansBySku.js';
@@ -95,6 +96,7 @@ export default class LibDashStore {
this.article = {
createUnderParent: articleCreateUnderParent(pool),
getBySku: articleGetBySku(pool),
listSearchIndex: articleListSearchIndex(pool),
updateBySku: articleUpdateBySku(pool),
setPricesBySku: articleSetPricesBySku(pool),
setEansBySku: articleSetEansBySku(pool),