You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
take note of the async method call on the user model: await user.get('allInstructedCourses');
this invokes the User::allInstructedCoursesgetter - this is not a method that returns a promise, there is nothing to await on. it appears to always be returning an empty array when invoked in this manner.
there are several other examples of this kind of mismatch.
CurrentUser::isTeachingCourse(course) is marred by the same problem
CurrentUser::isTeachingSession(session) calls the User::allInstructedSession getter - same problem.
The text was updated successfully, but these errors were encountered:
i banged my head against this for a while today.
this is best explained by example:
from the
current-user
service class, consider this method:take note of the async method call on the
user
model:await user.get('allInstructedCourses');
this invokes the
User::allInstructedCourses
getter - this is not a method that returns a promise, there is nothing to await on. it appears to always be returning an empty array when invoked in this manner.there are several other examples of this kind of mismatch.
CurrentUser::isTeachingCourse(course)
is marred by the same problemCurrentUser::isTeachingSession(session)
calls theUser::allInstructedSession
getter - same problem.The text was updated successfully, but these errors were encountered: