MCPcopy Create free account
hub / github.com/ethanniser/NextFaster / getEmptySubcategories

Function getEmptySubcategories

scripts/fill.ts:9–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7const fs = require("fs");
8
9const getEmptySubcategories = async () => {
10 const subcategoriesWithoutProducts = await db
11 .select()
12 .from(subcategories)
13 .leftJoin(products, eq(products.subcategory_slug, subcategories.slug))
14 .where(isNull(products.subcategory_slug));
15
16 return subcategoriesWithoutProducts.map((s) => s.subcategories.slug);
17};
18
19function getRandomObjects(arr: any[], count: number) {
20 const result = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected