Commit 41650ade authored by Emiliano Balbuena's avatar Emiliano Balbuena

(feat): Spinner while doing admin withdrawal operations

1 merge request!652(feat): Withdrawal status support
Pipeline #95490706 running with stages
......@@ -89,6 +89,7 @@
<button
class="mf-button mf-button--smaller"
[disabled]="inProgress"
(click)="approve(request)"
>
Approve
......@@ -96,6 +97,7 @@
<button
class="mf-button mf-button--destructive mf-button--smaller"
[disabled]="inProgress"
(click)="reject(request)"
>
Reject
......
......@@ -84,6 +84,8 @@ export class AdminWithdrawals {
return;
}
this.inProgress = true;
try {
const endpoint = `api/v2/admin/rewards/withdrawals/${[
withdrawal.user_guid,
......@@ -95,8 +97,13 @@ export class AdminWithdrawals {
withdrawal.status = 'approved';
} catch (e) {
alert('There was an issue while approving withdrawal');
alert(
`There was an issue while approving withdrawal: ${(e && e.message) ||
'Unknown server error'}`
);
}
this.inProgress = false;
}
async reject(withdrawal) {
......@@ -104,6 +111,8 @@ export class AdminWithdrawals {
return;
}
this.inProgress = true;
try {
const endpoint = `api/v2/admin/rewards/withdrawals/${[
withdrawal.user_guid,
......@@ -115,7 +124,12 @@ export class AdminWithdrawals {
withdrawal.status = 'rejected';
} catch (e) {
alert('There was an issue while rejecting withdrawal');
alert(
`There was an issue while rejecting withdrawal: ${(e && e.message) ||
'Unknown server error'}`
);
}
this.inProgress = false;
}
}
Please register or to comment