Skip to content

Commit 4d7702f

Browse files
update(OUT-2088): unhide settings button when submit error
1 parent 3e970e7 commit 4d7702f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/hook/useSettings.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ export const useProductMappingSettings = () => {
146146
)
147147
setChangedItemReference([])
148148
} else {
149-
console.error({ tableRes, settingRes })
150-
alert('Error submitting mapping items')
149+
setSettingShowConfirm(true) // show the update settings button if error
150+
console.error('Error submitting product settings', {
151+
tableRes,
152+
settingRes,
153+
})
151154
}
152155
}
153156

@@ -531,8 +534,8 @@ export const useInvoiceDetailSettings = () => {
531534
{ ...settingState, type: SettingType.INVOICE },
532535
)
533536
if (!res || res?.error) {
534-
console.error({ res })
535-
alert('Error submitting invoice settings')
537+
setShowButton(true) // show the update settings button if error
538+
console.error('Error submitting Invoice settings', { res })
536539
} else {
537540
mutate(`/api/quickbooks/setting?type=invoice&token=${token}`)
538541
}

0 commit comments

Comments
 (0)