fix: resolve variable declaration order, modal state and lint errors
Deploy Canina / deploy (push) Successful in 41s
Deploy Canina / deploy (push) Successful in 41s
This commit is contained in:
1 parent
fc324aacaf
commit
b2b80849ea
11 files changed
+353
-302
No files matched your search
@@ -596,8 +596,31 @@ export class AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
async getOrderById(id: string) {
|
||||
const order = await this.prisma.order.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
user: true,
|
||||
orderItems: {
|
||||
include: {
|
||||
product: true,
|
||||
},
|
||||
},
|
||||
coupon: true,
|
||||
paymentTransactions: {
|
||||
orderBy: { createdAt: 'desc' },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!order) {
|
||||
throw new NotFoundException(`سفارش با شناسه ${id} یافت نشد`);
|
||||
}
|
||||
return order;
|
||||
}
|
||||
|
||||
async updateOrderStatus(id: string, status: string, trackingNumber?: string) {
|
||||
const dataToUpdate: Prisma.OrderUpdateInput = { status };
|
||||
|
||||
if (trackingNumber !== undefined) {
|
||||
dataToUpdate.trackingNumber = trackingNumber;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user