From 1a66628ec84cab0c57c36a75e8b67f0835af575e Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 1 Nov 2021 17:46:53 -0300 Subject: [PATCH] Filtrar Product --- product.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/product.ts b/product.ts index 7aa7286..56d7c34 100644 --- a/product.ts +++ b/product.ts @@ -11,6 +11,7 @@ export interface ProductosQuery { * Decide si solo traer los productos habilitados. */ onlyEnabled?: boolean; + filter?: string; } export interface Producto { @@ -61,6 +62,9 @@ export async function getProductos( if ("onlyEnabled" in options) { searchParams.set("onlyEnabled", options.onlyEnabled ? "true" : "false"); } + if (options.filter) { + searchParams.set("filter", options.filter); + } const res = await fetch( `${HOST}/api/Aperture/Product?${searchParams.toString()}`, {