Skip to content

Commit

Permalink
fix: invalid prop passed to generic form
Browse files Browse the repository at this point in the history
  • Loading branch information
ayZagen committed Apr 4, 2024
1 parent d0c0986 commit 6e90c7d
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/ui/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type FieldValidator<T extends (string | number)> = (


export interface AdditionalFields {
[key: string]: FieldDefinition;
[key: string]: FieldDefinition | null | undefined;
}

export type FieldDefinition = {
Expand Down Expand Up @@ -115,8 +115,8 @@ export interface IWidgetSettings {
locale: ILocaleSettings;
mode?: string
modeOptions: Partial<Record<WidgetModes, {
fields: AdditionalFields,
responseErrorHandler: (
fields?: AdditionalFields,
responseErrorHandler?: (
err: Error,
form: ReturnType<typeof createForm> & {
toggleAlert(message?: string | null, options?: Partial<PAlertProps>): void
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/FillMissing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default defineComponent({
const contextFields = context?.details?.fields
const { form, loading, submit, validate, fields } = useGenericForm(
(settings.modeOptions || {}).fillMissing,
'fillMissing',
null,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/Email.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default defineComponent({
}
}
const { form, loading, submit, validate, fields } = useGenericForm(
(settings.modeOptions || {}).emailMfa,
'emailMfa',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/FingerVein.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default defineComponent({
const fv = new H1FingerVeinService()
const { form, loading, fields, validate } = useGenericForm(
(settings.modeOptions || {}).fvMfa
'fvMfa'
)
loading.value= true
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/OTP.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
}
}
const { form, loading, submit, fields, validate } = useGenericForm(
(settings.modeOptions || {}).otpMfa,
'otpMfa',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/Push.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default defineComponent({
}))
const { form, loading, submit, fields, validate } = useGenericForm(
(settings.modeOptions || {}).pushMfa,
'pushMfa',
defaultFields,
async (values, finalFields) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/SMS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineComponent({
}
}
const { form, loading, submit, validate, fields } = useGenericForm(
(settings.modeOptions || {}).smsMfa,
'smsMfa',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/mfa/WebAuthN.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default defineComponent({
}
}
const { form, loading, submit, fields, validate } = useGenericForm(
(settings.modeOptions || {}).webauthnMfa,
'webauthnMfa',
defaultFields,
async (values, finalFields) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/passwordless/Email.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default defineComponent({
}
}
const { form, loading, submit, validate, fields } = useGenericForm(
(settings.modeOptions || {}).passwordlessEmail,
'passwordlessEmail',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/passwordless/OTP.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default defineComponent({
}
}
const { form, loading, submit, fields, validate } = useGenericForm(
(settings.modeOptions || {}).passwordlessOtp,
'passwordlessOtp',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/passwordless/Push.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default defineComponent({
}))
const { form, loading, submit, fields, validate } = useGenericForm(
(settings.modeOptions || {}).passwordlessPush,
'passwordlessPush',
defaultFields,
async (values, finalFields) => {
try{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/passwordless/SMS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default defineComponent({
}
}
const { form, loading, submit, validate, fields } = useGenericForm(
(settings.modeOptions || {}).passwordlessSms,
'passwordlessSms',
defaultFields,
async (values, finalFields) => {
try{
Expand Down

0 comments on commit 6e90c7d

Please sign in to comment.