From 8c19ab61f63a1108279b7a25f39a630a3e89aa58 Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Thu, 29 Aug 2024 20:31:57 +0200 Subject: [PATCH] fix(dashboard): Fetch tags + types in product forms --- .../product-create-details-organize-section.tsx | 4 ++-- .../product-organization-form/product-organization-form.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/admin-next/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx b/packages/admin-next/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx index e4d5c32cdf291..c4598564a8349 100644 --- a/packages/admin-next/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx +++ b/packages/admin-next/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx @@ -34,7 +34,7 @@ export const ProductCreateOrganizationSection = ({ const types = useComboboxData({ queryKey: ["product_types"], - queryFn: sdk.admin.productType.list, + queryFn: (params) => sdk.admin.productType.list(params), getOptions: (data) => data.product_types.map((type) => ({ label: type.value, @@ -44,7 +44,7 @@ export const ProductCreateOrganizationSection = ({ const tags = useComboboxData({ queryKey: ["product_tags"], - queryFn: sdk.admin.productTag.list, + queryFn: (params) => sdk.admin.productTag.list(params), getOptions: (data) => data.product_tags.map((tag) => ({ label: tag.value, diff --git a/packages/admin-next/dashboard/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx b/packages/admin-next/dashboard/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx index 5745dab440f65..2cbc86644d98e 100644 --- a/packages/admin-next/dashboard/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx +++ b/packages/admin-next/dashboard/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx @@ -9,7 +9,7 @@ import { Combobox } from "../../../../../components/inputs/combobox" import { RouteDrawer, useRouteModal } from "../../../../../components/modals" import { useUpdateProduct } from "../../../../../hooks/api/products" import { useComboboxData } from "../../../../../hooks/use-combobox-data" -import { client, sdk } from "../../../../../lib/client" +import { sdk } from "../../../../../lib/client" import { CategoryCombobox } from "../../../common/components/category-combobox" type ProductOrganizationFormProps = { @@ -41,7 +41,7 @@ export const ProductOrganizationForm = ({ const types = useComboboxData({ queryKey: ["product_types"], - queryFn: sdk.admin.productType.list, + queryFn: (params) => sdk.admin.productType.list(params), getOptions: (data) => data.product_types.map((type) => ({ label: type.value, @@ -51,7 +51,7 @@ export const ProductOrganizationForm = ({ const tags = useComboboxData({ queryKey: ["product_tags"], - queryFn: sdk.admin.productTag.list, + queryFn: (params) => sdk.admin.productTag.list(params), getOptions: (data) => data.product_tags.map((tag) => ({ label: tag.value,