Browse Source

refactor(gui): show validation error in toast

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4459/head
Pranav C 2 years ago
parent
commit
a19564d9dd
  1. 11
      packages/nc-gui/composables/useColumnCreateStore.ts

11
packages/nc-gui/composables/useColumnCreateStore.ts

@ -197,7 +197,16 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
} catch (e) { } catch (e) {
console.log(e) console.log(e)
console.trace() console.trace()
message.error(t('msg.error.formValidationFailed'))
const errorMsgs = e.errorFields
?.map((e: any) => e.errors?.join(', '))
.filter(Boolean)
.join(', ')
if (errorMsgs) {
message.error(errorMsgs)
} else {
message.error(t('msg.error.formValidationFailed'))
}
return return
} }

Loading…
Cancel
Save