Backend • Introduced `validateExpiredTime` helper in `controller/redemption.go`; reused in both Add & Update endpoints to enforce “expiry time must not be earlier than now”, eliminating duplicated checks • Removed `RedemptionCodeStatusExpired` constant and all related references – expiry is now determined exclusively by the `expired_time` field for simpler, safer state management • Simplified `DeleteInvalidRedemptions`: deletes codes that are `used` / `disabled` or `enabled` but already expired, without relying on extra status codes • Controller no longer mutates `status` when listing or fetching redemption codes; clients derive expiry status from timestamp Frontend • Added reusable `isExpired` helper in `RedemptionsTable.js`; leveraged for: – status rendering (orange “Expired” tag) – action-menu enable/disable logic – row styling • Removed duplicated inline expiry logic, improving readability and performance • Adjusted toolbar layout: on small screens the “Clear invalid codes” button now wraps onto its own line, while “Add” & “Copy” remain grouped Result The codebase is now more maintainable, secure, and performant with no redundant constants, centralized validation, and cleaner UI behaviour across devices.
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| billing.go | Loading commit data... | |
| channel-billing.go | Loading commit data... | |
| channel-test.go | Loading commit data... | |
| channel.go | Loading commit data... | |
| github.go | Loading commit data... | |
| group.go | Loading commit data... | |
| image.go | Loading commit data... | |
| linuxdo.go | Loading commit data... | |
| log.go | Loading commit data... | |
| midjourney.go | Loading commit data... | |
| misc.go | Loading commit data... | |
| model.go | Loading commit data... | |
| oidc.go | Loading commit data... | |
| option.go | Loading commit data... | |
| playground.go | Loading commit data... | |
| pricing.go | Loading commit data... | |
| redemption.go | Loading commit data... | |
| relay.go | Loading commit data... | |
| setup.go | Loading commit data... | |
| task.go | Loading commit data... | |
| telegram.go | Loading commit data... | |
| token.go | Loading commit data... | |
| topup.go | Loading commit data... | |
| uptime_kuma.go | Loading commit data... | |
| usedata.go | Loading commit data... | |
| user.go | Loading commit data... | |
| wechat.go | Loading commit data... |