Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
fix: fixes language variants import condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Dec 4, 2023
1 parent 72513da commit c4039dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/import/import.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,17 @@ export class ImportService {
}
}

const languageVariantsToImport: LanguageVariantContracts.ILanguageVariantModelContract[] = [];
if (this.config.canImport && this.config.canImport.languageVariant) {
for (const item of source.importData.languageVariants) {
const shouldImport = this.config.canImport.languageVariant(item);
if (!shouldImport) {
source.importData.languageVariants = source.importData.languageVariants.filter(
(m) => m.item.id !== item.item.id && m.language.id !== item.language.id
);

if (shouldImport) {
languageVariantsToImport.push(item);
}
}
}
source.importData.languageVariants = languageVariantsToImport;

if (this.config.canImport && this.config.canImport.taxonomy) {
for (const item of source.importData.taxonomies) {
Expand Down

0 comments on commit c4039dd

Please sign in to comment.