mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
client and some admin new
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -148,9 +148,7 @@ exports.getUnits = async (req, res) => {
|
||||
: false;
|
||||
const product = productById.get(String(row.unit_id)) ?? null;
|
||||
const has_purchased = purchasedIds.has(String(row.unit_id));
|
||||
const purchase_eligible = (is_locked && product && !has_purchased)
|
||||
? await coursesCtrl.isPurchaseEligible(req.user.user_id, row.subscription, "unit", row.unit_id)
|
||||
: true;
|
||||
const purchase_eligible = true;
|
||||
result.push({
|
||||
...row,
|
||||
courses: coursesByUnit.get(row.unit_id) ?? [],
|
||||
@@ -216,9 +214,7 @@ exports.getLessons = async (req, res) => {
|
||||
: false;
|
||||
const product = productById.get(String(row.lesson_id)) ?? null;
|
||||
const has_purchased = purchasedIds.has(String(row.lesson_id));
|
||||
const purchase_eligible = (is_locked && product && !has_purchased)
|
||||
? await coursesCtrl.isPurchaseEligible(req.user.user_id, row.subscription, "lesson", row.lesson_id)
|
||||
: true;
|
||||
const purchase_eligible = true;
|
||||
result.push({
|
||||
...row,
|
||||
courses: coursesByLesson.get(row.lesson_id) ?? [],
|
||||
|
||||
Reference in New Issue
Block a user