fix(auth): query for session traces

This commit is contained in:
Karol Sójko 2022-12-20 19:52:23 +01:00
parent bf4a3be6d9
commit 14eb775749
No known key found for this signature in database
GPG key ID: A50543BF560BDEB0

View file

@ -14,7 +14,7 @@ export class MySQLSessionTraceRepository implements SessionTraceRepositoryInterf
return this.ormRepository
.createQueryBuilder('trace')
.where('trace.creation_date = :creationDate', {
creationDate: new Date(date.getFullYear(), date.getMonth(), date.getDate()),
creationDate: `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`,
})
.andWhere('trace.subscription_plan_name = :subscriptionPlanName', {
subscriptionPlanName: subscriptionPlanName.value,
@ -26,7 +26,7 @@ export class MySQLSessionTraceRepository implements SessionTraceRepositoryInterf
return this.ormRepository
.createQueryBuilder('trace')
.where('trace.creation_date = :creationDate', {
creationDate: new Date(date.getFullYear(), date.getMonth(), date.getDate()),
creationDate: `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`,
})
.getCount()
}
@ -44,7 +44,7 @@ export class MySQLSessionTraceRepository implements SessionTraceRepositoryInterf
.createQueryBuilder('trace')
.where('trace.user_uuid = :userUuid AND trace.creation_date = :creationDate', {
userUuid: userUuid.value,
creationDate: new Date(date.getFullYear(), date.getMonth(), date.getDate()),
creationDate: `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`,
})
.getOne()