feat(weeztix): add button to refresh coupon list from API

Made-with: Cursor
This commit is contained in:
2026-04-05 10:59:46 +02:00
parent 6561bda30d
commit 55434ce086
2 changed files with 32 additions and 1 deletions

View File

@@ -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;
}
},
}));
});