|
|
@@ -85,7 +85,7 @@ export class FastImporterService {
|
|
|
beforeSave: async p => {
|
|
|
p.channels = unique([this.defaultChannel, this.importCtx.channel], 'id');
|
|
|
if (input.facetValueIds) {
|
|
|
- p.facetValues = input.facetValueIds.map(id => ({ id } as any));
|
|
|
+ p.facetValues = input.facetValueIds.map(id => ({ id }) as any);
|
|
|
}
|
|
|
if (input.featuredAssetId) {
|
|
|
p.featuredAsset = { id: input.featuredAssetId } as any;
|
|
|
@@ -164,10 +164,10 @@ export class FastImporterService {
|
|
|
variant.channels = unique([this.defaultChannel, this.importCtx.channel], 'id');
|
|
|
const { optionIds } = input;
|
|
|
if (optionIds && optionIds.length) {
|
|
|
- variant.options = optionIds.map(id => ({ id } as any));
|
|
|
+ variant.options = optionIds.map(id => ({ id }) as any);
|
|
|
}
|
|
|
if (input.facetValueIds) {
|
|
|
- variant.facetValues = input.facetValueIds.map(id => ({ id } as any));
|
|
|
+ variant.facetValues = input.facetValueIds.map(id => ({ id }) as any);
|
|
|
}
|
|
|
variant.product = { id: input.productId } as any;
|
|
|
variant.taxCategory = { id: input.taxCategoryId } as any;
|
|
|
@@ -192,7 +192,7 @@ export class FastImporterService {
|
|
|
await this.stockMovementService.adjustProductVariantStock(
|
|
|
this.importCtx,
|
|
|
createdVariant.id,
|
|
|
- input.stockOnHand ?? 0,
|
|
|
+ input.stockLevels ?? 0,
|
|
|
);
|
|
|
const assignedChannelIds = unique([this.defaultChannel, this.importCtx.channel], 'id').map(c => c.id);
|
|
|
for (const channelId of assignedChannelIds) {
|