Skip to content

Commit

Permalink
fix(openalex): Apply corrections before sending to github !
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Jan 8, 2025
1 parent 33a2bd6 commit b41084c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export default function SendFeedbackButton({ className, corrections, resetCorrec

const sendFeedback = async () => {
try {
sendJsonMessage({ data: corrections, email: userEmail, type: 'openalex-affiliations' });
const data = corrections.map((correction) => ({
...correction,
rors: [...correction.rors, ...correction.addList].filter((ror) => !correction.removeList.includes(ror.rorId)),
}));
sendJsonMessage({ data, email: userEmail, type: 'openalex-affiliations' });
toast({
autoDismissAfter: 5000,
description: 'Your corrections are currently submitted to the <a href="https://github.com/dataesr/openalex-affiliations/issues" target="_blank">Github repository</a>',
Expand Down

0 comments on commit b41084c

Please sign in to comment.