From 3768705e6fe80d7e4818df4247e1ef1c2091adf6 Mon Sep 17 00:00:00 2001 From: joel Date: Tue, 19 Nov 2024 20:08:03 -0800 Subject: [PATCH] fix: types --- packages/ui/resources-crud/edit-resources-form-mobile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/resources-crud/edit-resources-form-mobile.tsx b/packages/ui/resources-crud/edit-resources-form-mobile.tsx index b506d4b59..15e3649fb 100644 --- a/packages/ui/resources-crud/edit-resources-form-mobile.tsx +++ b/packages/ui/resources-crud/edit-resources-form-mobile.tsx @@ -25,7 +25,7 @@ export function EditResourcesFormMobile({ user, tools = [], }: { - onSave: (resource: ContentResource) => Promise + onSave?: (resource: ContentResource) => Promise resource: ContentResource & { fields: { body?: string | null @@ -50,7 +50,7 @@ export function EditResourcesFormMobile({ }) { const onSubmit = async (values: z.infer) => { const updatedResource = await updateResource(values) - if (updatedResource) { + if (updatedResource && onSave) { onSave(updatedResource) } }