Skip to content

Commit

Permalink
CreateDandisetView: only allow one license
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandenburgh committed Feb 27, 2023
1 parent 67ae5c7 commit 7f2a040
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/src/views/CreateDandisetView/CreateDandisetView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
:items="dandiLicenses"
label="License*"
class="my-4"
multiple
outlined
dense
/>
Expand Down Expand Up @@ -114,7 +113,7 @@ import { useDandisetStore } from '@/stores/dandiset';
import { useRouter } from 'vue-router/composables';
import type { ComputedRef } from 'vue';
import type { IdentifierForAnAward, LicenseType, License } from '@/types';
import type { IdentifierForAnAward, LicenseType } from '@/types';
// Regular expression to validate an NIH award number.
// Based on https://era.nih.gov/files/Deciphering_NIH_Application.pdf
Expand All @@ -132,7 +131,7 @@ const store = useDandisetStore();
const name = ref('');
const description = ref('');
const license = ref<License>();
const license = ref<LicenseType>();
const embargoed = ref(false);
const awardNumber = ref('');
const saveDisabled = computed(
Expand All @@ -159,7 +158,14 @@ if (!loggedIn()) {
}
async function registerDandiset() {
const metadata = { name: name.value, description: description.value, license: license.value };
const metadata: Record<string, any> = {
name: name.value,
description: description.value,
};
if (license.value) {
metadata.license = license.value;
}
const { data } = embargoed.value
? await dandiRest.createEmbargoedDandiset(name.value, metadata, awardNumber.value)
Expand Down

0 comments on commit 7f2a040

Please sign in to comment.