Skip to content

Commit

Permalink
fix: various bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
swplange committed Dec 30, 2023
1 parent ba15f37 commit ebe4c14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/print_voucher.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function printUsingThermalPrinterLibrary(voucher) {
try {
let duration = time(voucher.duration);
let type = voucher.status === 'VALID_MULTI' ? 'multi-use' : 'single-use';
let usage_quota = voucher.quota === 1 ? `${voucher.qos_usage_quota} MB` : 'unlimited';
let usage_quota = voucher.qos_usage_quota !== undefined ? `${voucher.qos_usage_quota} MB` : 'unlimited';
let upload_limit = voucher.qos_rate_max_up !== undefined ? `${voucher.qos_rate_max_up} KBit/s` : 'unlimited';
let download_limit = voucher.qos_rate_max_down !== undefined ? `${voucher.qos_rate_max_down} KBit/s` : 'unlimited';

Expand Down
2 changes: 1 addition & 1 deletion modules/unifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports.getExistingVouchers = () => {
code: `${[voucher.code.slice(0, 5), '-', voucher.code.slice(5)].join('')}`,
duration: time(voucher.duration),
type: voucher.status === 'VALID_MULTI' ? 'multi-use' : 'single-use',
usage_quota: voucher.quota === 1 ? `${voucher.qos_usage_quota} MB` : 'unlimited',
usage_quota: voucher.qos_usage_quota !== undefined ? `${voucher.qos_usage_quota} MB` : 'unlimited',
upload_limit: voucher.qos_rate_max_up !== undefined ? `${voucher.qos_rate_max_up} KBit/s` : 'unlimited',
download_limit: voucher.qos_rate_max_down !== undefined ? `${voucher.qos_rate_max_down} KBit/s` : 'unlimited'
});
Expand Down

0 comments on commit ebe4c14

Please sign in to comment.