|
|
@@ -23,6 +23,7 @@ import { VendureEntity } from '../../entity/base/base.entity';
|
|
|
import { Channel } from '../../entity/channel/channel.entity';
|
|
|
import { ProductVariantPrice } from '../../entity/product-variant/product-variant-price.entity';
|
|
|
import { Zone } from '../../entity/zone/zone.entity';
|
|
|
+import { CustomFieldRelationService } from '../helpers/custom-field-relation/custom-field-relation.service';
|
|
|
import { patchEntity } from '../helpers/utils/patch-entity';
|
|
|
import { TransactionalConnection } from '../transaction/transactional-connection';
|
|
|
|
|
|
@@ -36,6 +37,7 @@ export class ChannelService {
|
|
|
private connection: TransactionalConnection,
|
|
|
private configService: ConfigService,
|
|
|
private globalSettingsService: GlobalSettingsService,
|
|
|
+ private customFieldRelationService: CustomFieldRelationService,
|
|
|
) {}
|
|
|
|
|
|
/**
|
|
|
@@ -159,6 +161,7 @@ export class ChannelService {
|
|
|
);
|
|
|
}
|
|
|
const newChannel = await this.connection.getRepository(ctx, Channel).save(channel);
|
|
|
+ await this.customFieldRelationService.updateRelations(ctx, Channel, input, newChannel);
|
|
|
await this.updateAllChannels(ctx);
|
|
|
return channel;
|
|
|
}
|
|
|
@@ -191,6 +194,7 @@ export class ChannelService {
|
|
|
);
|
|
|
}
|
|
|
await this.connection.getRepository(ctx, Channel).save(updatedChannel, { reload: false });
|
|
|
+ await this.customFieldRelationService.updateRelations(ctx, Channel, input, updatedChannel);
|
|
|
await this.updateAllChannels(ctx);
|
|
|
return assertFound(this.findOne(ctx, channel.id));
|
|
|
}
|