set consumer customers and saleInvoices
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
import { Request } from 'express'
|
||||
import { IConsumerPayload } from '../models'
|
||||
|
||||
export const ConsumerInfoInfo = createParamDecorator(
|
||||
export const ConsumerInfo = createParamDecorator(
|
||||
(data: keyof IConsumerPayload | undefined, ctx: ExecutionContext) => {
|
||||
try {
|
||||
const request = ctx.switchToHttp().getRequest<Request>()
|
||||
|
||||
@@ -41,9 +41,7 @@ export class ConsumerGuard {
|
||||
if (!consumer.license?.expires_at) {
|
||||
throw new ForbiddenException('برای کاربر شما لایسنس ایجاد نشده است.')
|
||||
}
|
||||
if (
|
||||
new Date().toUTCString() > new Date(consumer.license?.expires_at).toUTCString()
|
||||
) {
|
||||
if (new Date().getTime() > new Date(consumer.license?.expires_at).getTime()) {
|
||||
throw new ForbiddenException('لایسنس شما منقضی شده است.')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user