File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export const getEnrolledCourses = async (user: User) => {
17
17
// students have no reason to be in these courses.
18
18
// We also want to check if the user exists in the database
19
19
// before we try to upsert the enrolments.
20
- if ( user . iamGroups . includes ( employeeIam ) && getUserById ( user . id ) ) {
20
+ if ( user . iamGroups . includes ( employeeIam ) && ( await getUserById ( user . id ) ) ) {
21
21
await Enrolment . upsert (
22
22
{
23
23
userId : user . id ,
@@ -57,7 +57,7 @@ export const getEnrolledCourses = async (user: User) => {
57
57
export const getOwnCourses = async ( user : User ) => {
58
58
// We want to check if the user exists in the database
59
59
// before we try to upsert the enrolments
60
- if ( user . isAdmin && getUserById ( user . id ) ) {
60
+ if ( user . isAdmin && ( await getUserById ( user . id ) ) ) {
61
61
await Responsibility . upsert (
62
62
{
63
63
userId : user . id ,
You can’t perform that action at this time.
0 commit comments