Skip to content

Commit

Permalink
Dans le cas d'abos successifs, la date de début est décalée dun mois …
Browse files Browse the repository at this point in the history
…pour chaque abos après le premier.
  • Loading branch information
gfra54 committed Sep 5, 2024
1 parent b20e98f commit fa00ca3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/models/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export async function addSubscriptionsToMember(memberId, startDate, purchase, pu
const payloads = []
for (let i = 0; i < purchaseQuantity; i++) {
payload._id = nanoid(17)
payload.startDate = add(new Date(payload.startDate), {months: i}).toISOString().slice(0, 10)
payloads.push({...payload})
}

Expand Down

0 comments on commit fa00ca3

Please sign in to comment.