fix : free plan
This commit is contained in:
@@ -230,12 +230,17 @@ export class SubscriptionsService {
|
|||||||
|
|
||||||
if (plan.isFree) {
|
if (plan.isFree) {
|
||||||
isFree = true;
|
isFree = true;
|
||||||
const oneMonthAgo = dayjs().subtract(1, "month").toDate();
|
// const oneMonthAgo = dayjs().subtract(1, "month").toDate();
|
||||||
const existingFreePlanSubscription = await queryRunner.manager.findOne(UserSubscription, {
|
const existingFreePlanSubscription = await queryRunner.manager.findOne(UserSubscription, {
|
||||||
where: {
|
where: {
|
||||||
user: { id: userId },
|
user: { id: userId },
|
||||||
plan: { isFree: true },
|
plan: {
|
||||||
startDate: MoreThan(oneMonthAgo),
|
isFree: true,
|
||||||
|
service: {
|
||||||
|
id: serviceId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// startDate: MoreThan(oneMonthAgo),
|
||||||
},
|
},
|
||||||
relations: {
|
relations: {
|
||||||
plan: true,
|
plan: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user