From b41084c84a2d9aa3634a44fe4640c1746ab36efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Wed, 8 Jan 2025 11:19:18 +0100 Subject: [PATCH] fix(openalex): Apply corrections before sending to github ! --- .../components/send-feedback-button.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/pages/openalex-affiliations/components/send-feedback-button.jsx b/client/src/pages/openalex-affiliations/components/send-feedback-button.jsx index ed77b29..64537f2 100644 --- a/client/src/pages/openalex-affiliations/components/send-feedback-button.jsx +++ b/client/src/pages/openalex-affiliations/components/send-feedback-button.jsx @@ -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 Github repository',