Skip to content

Commit

Permalink
fix(affiliations): Fix affiliations if no affiliationIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Mar 20, 2024
1 parent e798b57 commit 16a2ab6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/utils/works.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cleanId, getAuthorOrcid, intersectArrays, removeDiacritics, removeDuplicates } from './utils';

const datasetsType = ['dataset', 'physicalobject', 'collection', 'audiovisual', 'sound',
'software', 'computationalnotebook', 'film', 'interactiveresource', 'image'];
'software', 'computationalnotebook', 'film', 'interactiveresource', 'image'];

const mergePublications = (publication1, publication2) => {
// Any publication from FOSM is prioritized among others
Expand Down Expand Up @@ -76,7 +76,7 @@ const getFosmQuery = (options, pit, searchAfter) => {
const getFosmAffiliation = (affiliation) => {
const source = 'FOSM';
let ror = null;
if (affiliation.affiliationIdentifierScheme?.toLowerCase() === 'ror') {
if (affiliation.affiliationIdentifierScheme?.toLowerCase() === 'ror' && affiliation?.affiliationIdentifier) {
ror = affiliation.affiliationIdentifier.replace('https://ror.org/', '').replace('ror.org/', '');
}
let rawAffiliation = affiliation?.name ?? '';
Expand Down

0 comments on commit 16a2ab6

Please sign in to comment.