Skip to content

Commit

Permalink
Update src/lib/server/orders.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Eliott C. <[email protected]>
  • Loading branch information
ithiame and coyotte508 authored Jun 16, 2023
1 parent 8b70f7b commit 2325922
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/server/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export async function onOrderPaid(order: Order, session: ClientSession) {
endsAt: { $gt: new Date() }
})
.toArray();
let sumProduct = 0;
for (let i = 0; i < order.items.length; i++) {
sumProduct += order.items[i].quantity;
}
let numberOfProducts = sum(order.items.map(item => item.quantity));
for (const challenge of challenges) {
await collections.challenges.updateOne(
{ _id: challenge._id },
Expand Down

0 comments on commit 2325922

Please sign in to comment.