Skip to content

Commit

Permalink
funders: fix country name display (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptamarit authored Jun 18, 2024
1 parent 87d7553 commit 575ec16
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 575ec16

Please sign in to comment.