mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
added and fix some of things
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -112,6 +112,29 @@ const LESSON_LIST_COMPUTED = [
|
||||
END
|
||||
)`,
|
||||
},
|
||||
{
|
||||
// Not its own column — consumed by the frontend's Subscription cell so a
|
||||
// lesson gated only through an affiliated course (own `subscription` is
|
||||
// NULL) still shows a tier instead of "-". Distinct tiers across every
|
||||
// affiliated course, comma-joined (a lesson can reach several courses
|
||||
// through several units, each possibly at a different tier).
|
||||
key: "course_subscription",
|
||||
label: "Course Subscription",
|
||||
type: "text",
|
||||
hidden: true,
|
||||
filterable: false,
|
||||
literal: `(
|
||||
SELECT STRING_AGG(sub.subscription, ', ')
|
||||
FROM (
|
||||
SELECT DISTINCT c.subscription
|
||||
FROM unit_lessons ul
|
||||
JOIN units u ON u.unit_id = ul.unit_id AND u."deletedAt" IS NULL
|
||||
JOIN course_units cu ON cu.unit_id = u.unit_id
|
||||
JOIN courses c ON c.course_id = cu.course_id AND c."deletedAt" IS NULL
|
||||
WHERE ul.lesson_id = "Lesson"."lesson_id"
|
||||
) sub
|
||||
)`,
|
||||
},
|
||||
];
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user