Skip to content

Commit f5243f4

Browse files
author
Rajat
committed
Fixed type
1 parent 0fc6e2b commit f5243f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/web/graphql/lessons/helpers.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ export async function isPartOfDripGroup(
196196
if (!course) {
197197
throw new Error(responses.item_not_found);
198198
}
199-
// @ts-expect-error _id exists at runtime via MongoDB
200-
const group = (course.groups ?? []).find(
201-
(group) => group._id === lesson.groupId,
202-
);
199+
const group = (course.groups ?? []).find((group) => {
200+
const groupId =
201+
(group as { _id?: string; id?: string })._id ?? group.id;
202+
return groupId === lesson.groupId;
203+
});
203204
if (group?.drip && group.drip.status) {
204205
return true;
205206
}

0 commit comments

Comments
 (0)