Skip to content

Commit f0f5ed7

Browse files
authored
Add in loader for refund button (#3454)
1 parent 33fe98c commit f0f5ed7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

auth-web/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auth-web",
3-
"version": "2.10.13",
3+
"version": "2.10.14",
44
"appName": "Auth Web",
55
"sbcName": "SBC Common Components",
66
"private": true,

auth-web/src/views/pay/RefundView.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@
210210
<br>
211211
<v-btn
212212
id="process-refund-btn"
213-
:disabled="isRefundSubmitDisabled"
213+
:disabled="isRefundSubmitDisabled || isLoading"
214+
:loading="isLoading"
214215
@click="processRefund"
215216
>
216217
REFUND
@@ -263,6 +264,7 @@ export default defineComponent({
263264
'Service Fees',
264265
'Action']
265266
const state = reactive({
267+
isLoading: false,
266268
form: null,
267269
shouldValidate: true,
268270
disableSubmit: false,
@@ -381,14 +383,18 @@ export default defineComponent({
381383
382384
async function processRefund () {
383385
try {
386+
state.isLoading = true
384387
const invoiceId = matchInvoiceId(state.invoiceId)
385388
const response = await state.orgStore.refundInvoice(invoiceId, getRefundPayload())
386389
state.refundResponse = 'Refund successful.'
387390
state.disableSubmit = true
388391
console.log('Refund successful:', response)
389392
} catch (error) {
393+
state.disableSubmit = false
390394
state.refundResponse = 'Refund failed.'
391395
console.error('Refund process failed:', error)
396+
} finally {
397+
state.isLoading = false
392398
}
393399
}
394400

0 commit comments

Comments
 (0)