implementando openAI y busqueda de productos en woo
This commit is contained in:
13
src/handlers/products.js
Normal file
13
src/handlers/products.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { searchProducts } from "../services/wooProducts.js";
|
||||
|
||||
export async function handleSearchProducts({ tenantId, q = "", limit = "10", forceWoo = "0" }) {
|
||||
const { items, source } = await searchProducts({
|
||||
tenantId,
|
||||
q,
|
||||
limit: parseInt(limit, 10) || 10,
|
||||
forceWoo: String(forceWoo) === "1" || String(forceWoo).toLowerCase() === "true",
|
||||
});
|
||||
return { items, source };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user