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

Commit

Permalink
fix: bug in remove models
Browse files Browse the repository at this point in the history
  • Loading branch information
mmintel committed Feb 4, 2020
1 parent b5c6ea6 commit ea54e1f
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 3 deletions.
Empty file modified .bin/clear-relations.js
100644 → 100755
Empty file.
Empty file modified .bin/export-content.js
100644 → 100755
Empty file.
Empty file modified .bin/export-menu.js
100644 → 100755
Empty file.
Empty file modified .bin/export-models.js
100644 → 100755
Empty file.
Empty file modified .bin/extract-models.js
100644 → 100755
Empty file.
Empty file modified .bin/import-content.js
100644 → 100755
Empty file.
Empty file modified .bin/import-menu.js
100644 → 100755
Empty file.
Empty file modified .bin/import-models.js
100644 → 100755
Empty file.
Empty file modified .bin/remove-models.js
100644 → 100755
Empty file.
Empty file modified .bin/reset-content.js
100644 → 100755
Empty file.
Empty file modified .bin/reset.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion dist/lib.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/remove-models.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { get } from 'lodash';
import { get, set } from 'lodash';

export default function ({ apiKeys, models }) {
let itemTypes;
Expand Down Expand Up @@ -43,7 +43,7 @@ export default function ({ apiKeys, models }) {
paths.forEach((path) => {
const relatedItemTypes = get(filteredField, path);
if (relatedItemTypes && relatedItemTypes.includes(itemType.id)) {
cleanedField.validators.itemsItemType.itemTypes = filteredField.validators.itemsItemType.itemTypes.filter((i) => i !== itemType.id);
set(cleanedField, path, relatedItemTypes.filter((i) => i !== itemType.id));
}
});
});
Expand Down

0 comments on commit ea54e1f

Please sign in to comment.