We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fc6e2b commit f5243f4Copy full SHA for f5243f4
apps/web/graphql/lessons/helpers.ts
@@ -196,10 +196,11 @@ export async function isPartOfDripGroup(
196
if (!course) {
197
throw new Error(responses.item_not_found);
198
}
199
- // @ts-expect-error _id exists at runtime via MongoDB
200
- const group = (course.groups ?? []).find(
201
- (group) => group._id === lesson.groupId,
202
- );
+ const group = (course.groups ?? []).find((group) => {
+ const groupId =
+ (group as { _id?: string; id?: string })._id ?? group.id;
+ return groupId === lesson.groupId;
203
+ });
204
if (group?.drip && group.drip.status) {
205
return true;
206
0 commit comments