fix: get the type of settings

This commit is contained in:
Rotimi Best
2026-06-10 09:08:57 +01:00
parent ab25b8e5d7
commit 02ae9b81b8
2 changed files with 5 additions and 3 deletions
+1 -2
View File
@@ -631,8 +631,7 @@ export async function enrollInCourse(
}
const courseMetadata = (courseWithRelations.metadata as { allowNewStudent?: boolean } | null) ?? null;
const isInternalEnrollmentOnly =
(org.settings as { internalEnrollmentOnly?: boolean } | null)?.internalEnrollmentOnly ?? false;
const isInternalEnrollmentOnly = org.settings?.internalEnrollmentOnly ?? false;
const orgMemberId = await getOrganizationMemberIdByOrgAndProfile(org.id, user.id);
+4 -1
View File
@@ -305,6 +305,7 @@ export type CourseWithRelations = TCourse & {
customDomain: string | null;
isCustomDomainVerified: boolean | null;
theme: string | null;
settings: (typeof schema.organization.$inferSelect)['settings'];
} | null;
};
@@ -349,6 +350,7 @@ export async function getCourseWithRelations(
customDomain: string | null;
isCustomDomainVerified: boolean | null;
theme: string | null;
settings: (typeof schema.organization.$inferSelect)['settings'];
} | null;
};
// Fetch group data (and org via join) if groupId exists
@@ -413,7 +415,8 @@ export async function getCourseWithRelations(
siteName: groupData[0].organization.siteName ?? null,
customDomain: groupData[0].organization.customDomain ?? null,
isCustomDomainVerified: groupData[0].organization.isCustomDomainVerified ?? null,
theme: groupData[0].organization.theme ?? null
theme: groupData[0].organization.theme ?? null,
settings: groupData[0].organization.settings ?? null
}
: null;