mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #26434 from overleaf/kh-limit-trial-extentions
[web] limit trial extensions GitOrigin-RevId: 57973190cdb57a04ce6a2585394bcb38321838f7
This commit is contained in:
@@ -693,12 +693,15 @@ const promises = {
|
||||
}
|
||||
},
|
||||
|
||||
async extendTrial(subscriptionId, daysUntilExpire) {
|
||||
async extendTrial(subscriptionId, trialEndsAt, daysUntilExpire) {
|
||||
if (daysUntilExpire == null) {
|
||||
daysUntilExpire = 7
|
||||
}
|
||||
if (trialEndsAt == null) {
|
||||
trialEndsAt = new Date()
|
||||
}
|
||||
const nextRenewalDate = new Date()
|
||||
nextRenewalDate.setDate(nextRenewalDate.getDate() + daysUntilExpire)
|
||||
nextRenewalDate.setDate(trialEndsAt.getDate() + daysUntilExpire)
|
||||
logger.debug(
|
||||
{ subscriptionId, daysUntilExpire },
|
||||
'Exending Free trial for user'
|
||||
|
||||
Reference in New Issue
Block a user