Skip to content

Commit

Permalink
Merge branch 'master' into all_vocabularies_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahW91 authored Jun 19, 2024
2 parents 5657042 + 575ec16 commit 2555b8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,9 @@ import Overridable from "react-overridable";

function CustomAwardForm({ deserializeFunder, selectedFunding }) {
function deserializeFunderToDropdown(funderItem) {
let funderName = null;
let funderPID = null;
let funderCountry = null;

if (funderItem.name) {
funderName = funderItem.name;
}

if (funderItem.id) {
funderPID = funderItem.id;
}

if (funderItem.country_name) {
funderCountry = funderItem.country_name;
}
const funderName = funderItem?.name;
const funderPID = funderItem?.id;
const funderCountry = funderItem?.country_name ?? funderItem?.country;

if (!funderName && !funderPID) {
return {};
Expand Down
1 change: 1 addition & 0 deletions invenio_vocabularies/contrib/funders/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ class FunderL10NItemSchema(Schema):
props = fields.Dict(dump_only=True)
name = fields.String(dump_only=True)
country = fields.String(dump_only=True)
country_name = fields.String(dump_only=True)
identifiers = fields.List(fields.Nested(IdentifierSchema), dump_only=True)

0 comments on commit 2555b8e

Please sign in to comment.