Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Added start date to cohort payload #78

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
7 changes: 6 additions & 1 deletion src/add-group-modal/AddGroupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,15 @@ const AddGroupModal = ({

const handleSubmit = () => {
if (validate()) {
const startDate = new Date().toISOString();
post({
uuid: cohortUuid,
name: name,
cohortMembers: patientList.map((p) => ({ patient: p.uuid })),
startDate: startDate,
cohortMembers: patientList.map((p) => ({
patient: p.uuid,
startDate: startDate,
Copy link
Member

@denniskigen denniskigen Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find the relevant info on whether cohortMembers supports a startDate property, @ibacher, @dkayiwa. Could you verify this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should.

I don't love defaulting this to the current date. This should probably be something the user can edit when adding a member to the group.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that sound reasonable, @icrc-psousa?

})),
});
if (onPostSubmit) {
onPostSubmit();
Expand Down