From 68d50e7cd1d0a527ab05214858bf0f06957e455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Thu, 23 Nov 2023 10:53:04 +0100 Subject: [PATCH] fix(api): Publication authors is now a flat array, close #32 --- server/src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/utils.js b/server/src/utils.js index ee7d3d70..03bada8e 100644 --- a/server/src/utils.js +++ b/server/src/utils.js @@ -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'], }); };