fix: get the type of settings
This commit is contained in:
@@ -631,8 +631,7 @@ export async function enrollInCourse(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const courseMetadata = (courseWithRelations.metadata as { allowNewStudent?: boolean } | null) ?? null;
|
const courseMetadata = (courseWithRelations.metadata as { allowNewStudent?: boolean } | null) ?? null;
|
||||||
const isInternalEnrollmentOnly =
|
const isInternalEnrollmentOnly = org.settings?.internalEnrollmentOnly ?? false;
|
||||||
(org.settings as { internalEnrollmentOnly?: boolean } | null)?.internalEnrollmentOnly ?? false;
|
|
||||||
|
|
||||||
const orgMemberId = await getOrganizationMemberIdByOrgAndProfile(org.id, user.id);
|
const orgMemberId = await getOrganizationMemberIdByOrgAndProfile(org.id, user.id);
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ export type CourseWithRelations = TCourse & {
|
|||||||
customDomain: string | null;
|
customDomain: string | null;
|
||||||
isCustomDomainVerified: boolean | null;
|
isCustomDomainVerified: boolean | null;
|
||||||
theme: string | null;
|
theme: string | null;
|
||||||
|
settings: (typeof schema.organization.$inferSelect)['settings'];
|
||||||
} | null;
|
} | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -349,6 +350,7 @@ export async function getCourseWithRelations(
|
|||||||
customDomain: string | null;
|
customDomain: string | null;
|
||||||
isCustomDomainVerified: boolean | null;
|
isCustomDomainVerified: boolean | null;
|
||||||
theme: string | null;
|
theme: string | null;
|
||||||
|
settings: (typeof schema.organization.$inferSelect)['settings'];
|
||||||
} | null;
|
} | null;
|
||||||
};
|
};
|
||||||
// Fetch group data (and org via join) if groupId exists
|
// Fetch group data (and org via join) if groupId exists
|
||||||
@@ -413,7 +415,8 @@ export async function getCourseWithRelations(
|
|||||||
siteName: groupData[0].organization.siteName ?? null,
|
siteName: groupData[0].organization.siteName ?? null,
|
||||||
customDomain: groupData[0].organization.customDomain ?? null,
|
customDomain: groupData[0].organization.customDomain ?? null,
|
||||||
isCustomDomainVerified: groupData[0].organization.isCustomDomainVerified ?? 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;
|
: null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user