From 103e301d57f51ff25631d31a64ce0a61f490ec19 Mon Sep 17 00:00:00 2001 From: aaronm-2112 Date: Wed, 23 Oct 2024 14:52:18 -0700 Subject: [PATCH] fix: principal investigator contributor not checke --- .../src/scripts/guided-mode/guided-curate-dataset.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/scripts/guided-mode/guided-curate-dataset.js b/src/renderer/src/scripts/guided-mode/guided-curate-dataset.js index 858742143..1baadb1d2 100644 --- a/src/renderer/src/scripts/guided-mode/guided-curate-dataset.js +++ b/src/renderer/src/scripts/guided-mode/guided-curate-dataset.js @@ -1934,8 +1934,16 @@ const savePageChanges = async (pageBeingLeftID) => { throw errorArray; } + console.log(contributors) + let piContributors = [] // Ensure at least one PI is assigned - const piContributors = contributors.filter((contributor) => contributor["role"] === "PI"); + for (const contributor of contributors) { + for (const role of contributor.conRole) { + if (role === "PrincipalInvestigator") { + piContributors.push(contributor); + } + } + } if (piContributors.length === 0) { errorArray.push({ type: "notyf",