|
|
@ -279,13 +279,18 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share |
|
|
|
handleAddMissingRequiredFieldDefaultState() |
|
|
|
handleAddMissingRequiredFieldDefaultState() |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
await validate([ |
|
|
|
// filter `undefined` keys which is hidden prefilled fields
|
|
|
|
|
|
|
|
await validate( |
|
|
|
|
|
|
|
[ |
|
|
|
...Object.keys(formState.value).map((title) => fieldMappings.value[title]), |
|
|
|
...Object.keys(formState.value).map((title) => fieldMappings.value[title]), |
|
|
|
...Object.keys(additionalState.value).map((title) => fieldMappings.value[title]), |
|
|
|
...Object.keys(additionalState.value).map((title) => fieldMappings.value[title]), |
|
|
|
]) |
|
|
|
].filter((v) => v !== undefined), |
|
|
|
|
|
|
|
) |
|
|
|
return true |
|
|
|
return true |
|
|
|
} catch (e: any) { |
|
|
|
} catch (e: any) { |
|
|
|
if (e.errorFields.length) { |
|
|
|
console.error('Error occurred while validating all fields:', e) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e?.errorFields?.length) { |
|
|
|
message.error(t('msg.error.someOfTheRequiredFieldsAreEmpty')) |
|
|
|
message.error(t('msg.error.someOfTheRequiredFieldsAreEmpty')) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
@ -325,7 +330,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share |
|
|
|
submitted.value = true |
|
|
|
submitted.value = true |
|
|
|
progress.value = false |
|
|
|
progress.value = false |
|
|
|
} catch (e: any) { |
|
|
|
} catch (e: any) { |
|
|
|
console.log(e) |
|
|
|
console.error(e) |
|
|
|
await message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|
await message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|
} |
|
|
|
} |
|
|
|
progress.value = false |
|
|
|
progress.value = false |
|
|
@ -643,7 +648,11 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share |
|
|
|
additionalState, |
|
|
|
additionalState, |
|
|
|
async () => { |
|
|
|
async () => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
await validate(Object.keys(additionalState.value).map((title) => fieldMappings.value[title])) |
|
|
|
await validate( |
|
|
|
|
|
|
|
Object.keys(additionalState.value) |
|
|
|
|
|
|
|
.map((title) => fieldMappings.value[title]) |
|
|
|
|
|
|
|
.filter((v) => v !== undefined), |
|
|
|
|
|
|
|
) |
|
|
|
} catch {} |
|
|
|
} catch {} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|