Skip to content

Commit e0f0471

Browse files
committed
Add missing awaits
1 parent 584892e commit e0f0471

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/chatInstances/access.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const getEnrolledCourses = async (user: User) => {
1717
// students have no reason to be in these courses.
1818
// We also want to check if the user exists in the database
1919
// 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))) {
2121
await Enrolment.upsert(
2222
{
2323
userId: user.id,
@@ -57,7 +57,7 @@ export const getEnrolledCourses = async (user: User) => {
5757
export const getOwnCourses = async (user: User) => {
5858
// We want to check if the user exists in the database
5959
// before we try to upsert the enrolments
60-
if (user.isAdmin && getUserById(user.id)) {
60+
if (user.isAdmin && (await getUserById(user.id))) {
6161
await Responsibility.upsert(
6262
{
6363
userId: user.id,

0 commit comments

Comments
 (0)