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

Ensure participant properties at site metadata #658

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion server/controllers/api/assessmentDayDataController/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ const AssessmentDayDataController = {
await SiteMetadataModel.upsert(
appDb,
{ study },
{ $addToSet: { participants: participant } }
{
$addToSet: {
participants: {
Active: 1,
Consent: new Date(),

Choose a reason for hiding this comment

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

Should this be a date from the metadata, or do we track consent based on upload date?

study,
participant,
synced: new Date(),
},
Comment on lines +78 to +84

Choose a reason for hiding this comment

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

does it matter that participants is no longer a participant, but now contains a participant?

Thinking of a scenario where something like participants.name used to work, but now it would need to be participants.participant.name

can/should we spread participant?

Suggested change
participants: {
Active: 1,
Consent: new Date(),
study,
participant,
synced: new Date(),
},
participants: {
Active: 1,
Consent: new Date(),
study,
synced: new Date(),
...participant,
},

Also just based on participants being plural, should this be an array of participant objects?

},
}
)
}
}
Expand Down
Loading