Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Nov 20, 2024
1 parent b13f623 commit 3768705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/resources-crud/edit-resources-form-mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function EditResourcesFormMobile({
user,
tools = [],
}: {
onSave: (resource: ContentResource) => Promise<void>
onSave?: (resource: ContentResource) => Promise<void>
resource: ContentResource & {
fields: {
body?: string | null
Expand All @@ -50,7 +50,7 @@ export function EditResourcesFormMobile({
}) {
const onSubmit = async (values: z.infer<typeof resourceSchema>) => {
const updatedResource = await updateResource(values)
if (updatedResource) {
if (updatedResource && onSave) {
onSave(updatedResource)
}
}
Expand Down

0 comments on commit 3768705

Please sign in to comment.