Explorar el Código

fix(core): Fix publishing CustomerEvent without customer ID

Michael Bromley hace 4 años
padre
commit
03cd5d7391
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/core/src/service/services/customer.service.ts

+ 1 - 1
packages/core/src/service/services/customer.service.ts

@@ -544,7 +544,7 @@ export class CustomerService {
             customer = patchEntity(existing, input);
             customer.channels.push(await this.connection.getEntityOrThrow(ctx, Channel, ctx.channelId));
         } else {
-            customer = new Customer(input);
+            customer = await this.connection.getRepository(ctx, Customer).save(new Customer(input));
             this.channelService.assignToCurrentChannel(customer, ctx);
             this.eventBus.publish(new CustomerEvent(ctx, customer, 'created'));
         }