Skip to content

Commit

Permalink
fix ?
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjeangirard committed Mar 5, 2024
1 parent 89a2646 commit cd7e154
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/src/utils/works.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const deduplicateWorks = (works) => {
const deduplicatedWorks = works.reduce((deduplicatedWorksTmp, work) => {
const { id } = work;
// eslint-disable-next-line no-param-reassign
deduplicatedWorksTmp[id] = deduplicatedWorksTmp[id] ? mergePublications(deduplicatedWorksTmp[id], work) : work;
if (deduplicatedWorksTmp[id]) {
deduplicatedWorksTmp.id = mergePublications(deduplicatedWorksTmp[id], work);
} else {
deduplicatedWorksTmp[id] = work;
}
// deduplicatedWorksTmp[id] = deduplicatedWorksTmp[id] ? mergePublications(deduplicatedWorksTmp[id], work) : work;
return deduplicatedWorksTmp;
}, {});
return Object.values(deduplicatedWorks);
Expand Down

0 comments on commit cd7e154

Please sign in to comment.