Skip to content

Commit

Permalink
fix(api): Publication authors is now a flat array, close #32
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Nov 23, 2023
1 parent 2110a52 commit 68d50e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ const mergePublications = (publication1, publication2) => {
affiliations: [...publication1.affiliations, ...publication2.affiliations],
// Filter allIds by unique values
allIds: Object.values([...publication1.allIds, ...publication2.allIds].reduce((acc, obj) => ({ ...acc, [obj.id_value]: obj }), {})),
// Filter authors by unique full_name
authors: Object.values([...publication1.authors, ...publication2.authors].reduce((acc, obj) => ({ ...acc, [obj.full_name]: obj }), {})),
// Filter authors by unique
authors: [...new Set([...publication1.authors, ...publication2.authors])],
datasource: ['bso', 'openalex'],
});
};
Expand Down

0 comments on commit 68d50e7

Please sign in to comment.