-
Notifications
You must be signed in to change notification settings - Fork 1
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
Small async changes to assessment request #606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomlovesgithub can you walk me through these changes. I'm a little confused!
functions/actions/assessments.js
Outdated
|
||
// get assessments | ||
let assessmentsRef = db.collection('assessments') | ||
let assessmentsRef = await db.collection('assessments') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an await
here doesn't look right. We are constructing assessmentsRef
in lines 289 - 301 and actually using it, with await
, on line 303
functions/actions/assessments.js
Outdated
return res; | ||
}); | ||
|
||
let result = await validateAssessorEmailAddresses(assessments).then((res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here ^^
@@ -301,6 +301,7 @@ module.exports = (config, firebase, db) => { | |||
const assessments = await getDocuments(assessmentsRef); | |||
|
|||
let result = validateAssessorEmailAddresses(assessments); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😚👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tomlovesgithub this is a good fix 👍
I was unsure of where the function was failing, as there was no errors logged and the function was returning true.
I believe that these changes, specifically where noted below have fixed the issue, and testing between this branch and develop, confirms this.