Skip to content

Commit

Permalink
Normalize casing on discount codes
Browse files Browse the repository at this point in the history
  • Loading branch information
brundonsmith committed Mar 6, 2024
1 parent 2dd9b6c commit 54f9eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion back-end/routes/v1/purchase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function register(router: Router) {
}
}

const discounts = Array.from(new Set(discount_codes)).map(code => TABLE_ROWS.discount.filter(d => d.discount_code === code)).flat()
const discounts = Array.from(new Set(discount_codes.map(c => c.toLocaleUpperCase()))).map(code => TABLE_ROWS.discount.filter(d => d.discount_code.toLocaleUpperCase() === code)).flat()

const sanitizedPurchases = objectFromEntries(objectEntries(purchases).map(
([purchaseType, count]) => {
Expand Down

0 comments on commit 54f9eff

Please sign in to comment.