diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-10 05:02:39 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-10 05:02:39 +0000 |
| commit | 9f8664c33429e41c6133ba2b325662245ffbc92d (patch) | |
| tree | bce73d880f28edb48810fe263c8bcd717339b9be /indoteknik_api/controllers/api_v1 | |
| parent | 1e3ea5f5df6794ffb5712389deca6d0d868cfc0a (diff) | |
| parent | 659268250145b51e8700bc01871ae3bba34f76f3 (diff) | |
Merged in change/feature/voucher (pull request #96)
Change/feature/voucher
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/voucher.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/voucher.py b/indoteknik_api/controllers/api_v1/voucher.py index 3a2c798e..0b769ee7 100644 --- a/indoteknik_api/controllers/api_v1/voucher.py +++ b/indoteknik_api/controllers/api_v1/voucher.py @@ -75,5 +75,7 @@ class Voucher(controller.Controller): voucher['has_flashsale_products'] = has_flashsale_products voucher['discount_voucher'] = discount_voucher voucher['difference_to_apply'] = difference_to_apply + + sorted_vouchers = sorted(vouchers, key=lambda x: x['can_apply'], reverse=True) - return self.response(vouchers) + return self.response(sorted_vouchers) |
