Browse Source

chore(gui-v2): mark onSuccess optional

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
b44d50d3c7
  1. 4
      packages/nc-gui-v2/composables/useColumnCreateStore.ts

4
packages/nc-gui-v2/composables/useColumnCreateStore.ts

@ -172,7 +172,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
if (cdf) formState.value.cdf = formState.value.cdf || null
}
const addOrUpdate = async (onSuccess: () => {}) => {
const addOrUpdate = async (onSuccess?: () => {}) => {
try {
console.log(formState, validators)
if (!(await validate())) return
@ -196,7 +196,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
toast.success('Column created')
}
onSuccess()
onSuccess?.()
} catch (e: any) {
const error = await extractSdkResponseErrorMsg(e)
if (error) toast.error(await extractSdkResponseErrorMsg(e))

Loading…
Cancel
Save