Skip to content

Commit

Permalink
Reuse in FormData.vue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Dec 18, 2024
1 parent 0836255 commit 1df87b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/components/Form/Elements/FormData/FormData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,15 @@ function canAcceptSrc(historyContentType: "dataset" | "dataset_collection", coll
}
}
const collectionTypesWithBuilders = ["list", "list:paired", "paired"];
/** Allowed collection types for collection creation */
const effectiveCollectionTypes = props.collectionTypes?.filter((collectionType) =>
["list", "list:paired", "paired"].includes(collectionType)
collectionTypesWithBuilders.includes(collectionType)
);
function buildNewCollection(collectionType: string) {
if (!["list", "list:paired", "paired"].includes(collectionType)) {
if (!collectionTypesWithBuilders.includes(collectionType)) {
throw Error(`Unknown collection type: ${collectionType}`);
}
collectionModalType.value = collectionType as "list" | "list:paired" | "paired";
Expand Down

0 comments on commit 1df87b8

Please sign in to comment.