update entity id

This commit is contained in:
2026-02-05 10:08:37 +03:30
parent d4ae03fa4f
commit 068286e505
37 changed files with 185 additions and 209 deletions
+10 -10
View File
@@ -98,7 +98,7 @@ export class OrderService {
for (const item of items) {
if (item.id) { // update
const currentItem = order.items.find(i => Number(i.id) == item.id)
const currentItem = order.items.find(i => i.id == item.id)
if (!currentItem) {
throw new BadGatewayException("Order Item not found")
@@ -206,7 +206,7 @@ export class OrderService {
return orderItem
}
async updateOrderItemAsUser(userId: string, orderId: string, itemId: number, dto: UpdateOrderItemDtoAsUser) {
async updateOrderItemAsUser(userId: string, orderId: string, itemId: string, dto: UpdateOrderItemDtoAsUser) {
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
@@ -227,7 +227,7 @@ export class OrderService {
return updated
}
async updateOrderItemAsAdmin(orderId: string, itemId: number, dto: UpdateOrderItemDtoAsAdmin) {
async updateOrderItemAsAdmin(orderId: string, itemId: string, dto: UpdateOrderItemDtoAsAdmin) {
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
@@ -240,7 +240,7 @@ export class OrderService {
return updated
}
async createPrintForm(orderId: string, itemId: number, dto: CreatePrintFormDto) {
async createPrintForm(orderId: string, itemId: string, dto: CreatePrintFormDto) {
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
@@ -249,7 +249,7 @@ export class OrderService {
return updated
}
async removeOrderItemAsAdmin(orderId: string, itemId: number) {
async removeOrderItemAsAdmin(orderId: string, itemId: string) {
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
@@ -262,7 +262,7 @@ export class OrderService {
return { message: 'success' }
}
async removeOrderItemAsUser(userId: string, orderId: string, itemId: number) {
async removeOrderItemAsUser(userId: string, orderId: string, itemId: string) {
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
@@ -363,7 +363,7 @@ export class OrderService {
// return order
// }
async confirmOrderItem(userId: string, orderId: string, orderItemId: number) {
async confirmOrderItem(userId: string, orderId: string, orderItemId: string) {
const orderItem = await this.findOrderItemOrFail(orderId, orderItemId)
@@ -379,7 +379,7 @@ export class OrderService {
return orderItem
}
async assignDesigner(orderId: string, orderItemId: number, designerId: string) {
async assignDesigner(orderId: string, orderItemId: string, designerId: string) {
const orderItem = await this.findOrderItemOrFail(orderId, orderItemId)
@@ -651,7 +651,7 @@ export class OrderService {
return order
}
async findOrderItemOrFail(orderId: string, itemId: number) {
async findOrderItemOrFail(orderId: string, itemId: string) {
const orderItem = await this.orderItemRepository.findOne({ id: itemId, order: { id: orderId } },
{ populate: ['order', 'order.user'] })
if (!orderItem) {
@@ -660,7 +660,7 @@ export class OrderService {
return orderItem
}
async findOrderItemOrFailByItemId(itemId: number) {
async findOrderItemOrFailByItemId(itemId: string) {
const orderItem = await this.orderItemRepository.findOne({ id: itemId },
{ populate: ['order', 'order.user'] })
if (!orderItem) {