Skip to content

Commit 1c18a8c

Browse files
committed
Fixed: missing fields description and affiliation added to collection creation
1 parent 9f3117b commit 1c18a8c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/collections/infra/repositories/CollectionsRepository.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export interface NewCollectionRequestPayload {
99
name: string
1010
dataverseContacts: NewCollectionContactRequestPayload[]
1111
dataverseType: string
12+
description?: string
13+
affiliation?: string
1214
metadataBlocks: NewCollectionMetadataBlocksRequestPayload
1315
}
1416

@@ -65,6 +67,12 @@ export class CollectionsRepository extends ApiRepository implements ICollections
6567
name: collectionDTO.name,
6668
dataverseContacts: dataverseContacts,
6769
dataverseType: collectionDTO.type,
70+
...(collectionDTO.description && {
71+
description: collectionDTO.description
72+
}),
73+
...(collectionDTO.affiliation && {
74+
affiliation: collectionDTO.affiliation
75+
}),
6876
metadataBlocks: {
6977
metadataBlockNames: collectionDTO.metadataBlockNames,
7078
facetIds: collectionDTO.facetIds,

test/testHelpers/collections/collectionHelper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ export const createCollectionDTO = (alias = 'test-collection'): CollectionDTO =>
125125
type: CollectionType.DEPARTMENT,
126126
metadataBlockNames: ['citation', 'geospatial'],
127127
facetIds: ['authorName', 'authorAffiliation'],
128+
description: 'test description',
129+
affiliation: 'test affiliation',
128130
inputLevels: [
129131
{
130132
datasetFieldName: 'geographicCoverage',
@@ -145,6 +147,8 @@ export const createNewCollectionRequestPayload = (): NewCollectionRequestPayload
145147
}
146148
],
147149
dataverseType: 'DEPARTMENT',
150+
description: 'test description',
151+
affiliation: 'test affiliation',
148152
metadataBlocks: {
149153
metadataBlockNames: ['citation', 'geospatial'],
150154
facetIds: ['authorName', 'authorAffiliation'],

0 commit comments

Comments
 (0)