Enrolment issue
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"users": {},
|
"users": {},
|
||||||
"updatedAt": "2026-06-05T13:00:29.596Z"
|
"updatedAt": "2026-06-08T18:21:54.358Z"
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,6 @@ export function register(app) {
|
|||||||
res.json({
|
res.json({
|
||||||
enrolledStudySlugs: Array.isArray(user.enrolledStudySlugs) ? user.enrolledStudySlugs : [],
|
enrolledStudySlugs: Array.isArray(user.enrolledStudySlugs) ? user.enrolledStudySlugs : [],
|
||||||
availableStudies: getStudyCatalog()
|
availableStudies: getStudyCatalog()
|
||||||
.filter(study => study.status !== 'planned')
|
|
||||||
.map(study => ({ slug: study.slug, title: study.title })),
|
.map(study => ({ slug: study.slug, title: study.title })),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export function getStudyCatalog() {
|
|||||||
export function isEnrollableStudySlug(studySlug) {
|
export function isEnrollableStudySlug(studySlug) {
|
||||||
const normalized = normalizeStudySlug(studySlug)
|
const normalized = normalizeStudySlug(studySlug)
|
||||||
if (!normalized) return false
|
if (!normalized) return false
|
||||||
return getStudyCatalog().some(study => study.slug === normalized && study.status !== 'planned')
|
return getStudyCatalog().some(study => study.slug === normalized)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getStudyTitleBySlug(studySlug) {
|
export function getStudyTitleBySlug(studySlug) {
|
||||||
|
|||||||
Reference in New Issue
Block a user