From 2744068f8ebe88912fe50b04396468f1bda3a19c Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Mon, 3 Jun 2024 17:29:48 +0200 Subject: [PATCH] fix(core): Fix regression in updating of Order custom fields --- packages/core/src/service/services/order.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/service/services/order.service.ts b/packages/core/src/service/services/order.service.ts index 46dd621ce9..3f20d0b4a5 100644 --- a/packages/core/src/service/services/order.service.ts +++ b/packages/core/src/service/services/order.service.ts @@ -472,8 +472,8 @@ export class OrderService { async updateCustomFields(ctx: RequestContext, orderId: ID, customFields: any) { let order = await this.getOrderOrThrow(ctx, orderId); order = patchEntity(order, { customFields }); - await this.customFieldRelationService.updateRelations(ctx, Order, { customFields }, order); const updatedOrder = await this.connection.getRepository(ctx, Order).save(order); + await this.customFieldRelationService.updateRelations(ctx, Order, { customFields }, updatedOrder); await this.eventBus.publish(new OrderEvent(ctx, updatedOrder, 'updated')); return updatedOrder; }