From 02a80ed98480cb27a9de65da8f9efb95c39671c5 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 21 Aug 2024 10:33:57 -0700 Subject: [PATCH] Dont add brand to search context without id --- apps/web/src/components/bottleForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/bottleForm.tsx b/apps/web/src/components/bottleForm.tsx index c38ac886..122c5270 100644 --- a/apps/web/src/components/bottleForm.tsx +++ b/apps/web/src/components/bottleForm.tsx @@ -343,7 +343,7 @@ export default function BottleForm({ error={errors.distillers} searchContext={{ type: "distiller", - brand: brandValue ? Number(brandValue.id) : null, + brand: brandValue?.id ? Number(brandValue.id) : null, bottleName: watch("name"), }} label="Distiller" @@ -397,7 +397,7 @@ export default function BottleForm({ suggestedOptions={brandValue ? [brandValue] : []} searchContext={{ type: "bottler", - brand: brandValue ? Number(brandValue.id) : null, + brand: brandValue?.id ? Number(brandValue.id) : null, bottleName: watch("name"), }} onChange={(value) => {