order
This commit is contained in:
@@ -43,14 +43,6 @@ export class OrderService {
|
|||||||
private readonly userService: UserService,
|
private readonly userService: UserService,
|
||||||
private readonly adminService: AdminService,
|
private readonly adminService: AdminService,
|
||||||
private readonly orderPrintRepository: OrderPrintRepository,
|
private readonly orderPrintRepository: OrderPrintRepository,
|
||||||
private readonly productService: ProductService,
|
|
||||||
private readonly productRepository: ProductRepository,
|
|
||||||
private readonly ticketRepository: ChatRepository,
|
|
||||||
private readonly ticketService: ChattService,
|
|
||||||
private readonly eventEmitter: EventEmitter2,
|
|
||||||
private readonly adminRepository: AdminRepository,
|
|
||||||
private readonly paymentRepository: PaymentRepository,
|
|
||||||
private readonly permissionService: PermissionService,
|
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async createOrderAsAdmin(adminId: string, dto: CreateOrderAsAdminDto): Promise<Order> {
|
async createOrderAsAdmin(adminId: string, dto: CreateOrderAsAdminDto): Promise<Order> {
|
||||||
@@ -66,13 +58,13 @@ export class OrderService {
|
|||||||
user = invoiceItem.invoice.user
|
user = invoiceItem.invoice.user
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!invoiceItem) {
|
if (!dto.invoiceItemId) {
|
||||||
|
|
||||||
if (!dto.userId) {
|
if (!dto.userId) {
|
||||||
throw new NotFoundException(`UserId is mandatory`);
|
throw new NotFoundException(`UserId is required`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await this.userService.findById(dto.userId);
|
user = await this.userService.findById(dto.userId);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
throw new NotFoundException(`User with ID ${dto.userId} not found.`);
|
throw new NotFoundException(`User with ID ${dto.userId} not found.`);
|
||||||
|
|||||||
Reference in New Issue
Block a user