Skip to content

Commit

Permalink
Merge pull request #33 from M3nin0/dev
Browse files Browse the repository at this point in the history
serializer: including marketplace-related fields
  • Loading branch information
M3nin0 authored Mar 7, 2024
2 parents 6637852 + 671e9b4 commit 3526e5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/DepositRecordSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class RDMDepositRecordSerializer extends DepositRecordSerializer {
locations: new LocationsFieldSerializer({
fieldpath: "metadata.locations.features",
}),
// Custom fields
// Custom fields - General
geo_work_programme_activity: new VocabularyField({
fieldpath: "metadata.geo_work_programme_activity",
deserializedDefault: "",
Expand All @@ -287,6 +287,15 @@ export class RDMDepositRecordSerializer extends DepositRecordSerializer {
relationship: new Field({
fieldpath: "relationship",
}),
// Custom fields - Marketplace
launch_url: new Field({
fieldpath: "metadata.marketplace.launch_url",
deserializedDefault: "",
}),
vendor_contact: new Field({
fieldpath: "metadata.marketplace.vendor_contact",
deserializedDefault: "",
}),
};
}

Expand Down
8 changes: 8 additions & 0 deletions src/lib/DepositRecordSerializer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ describe("RDMDepositRecordSerializer tests", () => {
subjects: [],
rights: [],
funding: [],
marketplace: {
launch_url: "",
vendor_contact: "",
},
version: "",
geo_work_programme_activity: "",
target_audiences: [],
Expand Down Expand Up @@ -353,6 +357,10 @@ describe("RDMDepositRecordSerializer tests", () => {
},
},
metadata: {
marketplace: {
launch_url: "",
vendor_contact: "",
},
contributors: [
{
affiliations: [],
Expand Down

0 comments on commit 3526e5e

Please sign in to comment.