feat(weeztix): add button to refresh coupon list from API
Made-with: Cursor
This commit is contained in:
@@ -779,6 +779,7 @@ document.addEventListener('alpine:init', () => {
|
||||
couponName: '',
|
||||
codePrefix: 'PREREG',
|
||||
usageCount: 1,
|
||||
couponsRefreshing: false,
|
||||
strings: cfg.strings || {},
|
||||
|
||||
async init() {
|
||||
@@ -853,6 +854,18 @@ document.addEventListener('alpine:init', () => {
|
||||
this.ensureSelectedCouponInList();
|
||||
this.syncCouponName();
|
||||
},
|
||||
|
||||
async refreshCoupons() {
|
||||
if (!this.isConnected) {
|
||||
return;
|
||||
}
|
||||
this.couponsRefreshing = true;
|
||||
try {
|
||||
await this.loadCoupons();
|
||||
} finally {
|
||||
this.couponsRefreshing = false;
|
||||
}
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user