mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
ordered models for lessons and units
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -142,8 +142,11 @@ const TYPE_HANDLERS = {
|
||||
});
|
||||
if (!progress) return false;
|
||||
if (progress.completed) return true;
|
||||
const minPercent = requirement.min_percent ?? 100;
|
||||
return (progress.progress_percent ?? 0) >= minPercent;
|
||||
// CockroachDB returns INTEGER columns as strings over the wire (same class of
|
||||
// issue as the BigInt precision fix) — without Number() coercion this becomes a
|
||||
// lexicographic string comparison, where e.g. "7" >= "100" is true.
|
||||
const minPercent = Number(requirement.min_percent ?? 100);
|
||||
return Number(progress.progress_percent ?? 0) >= minPercent;
|
||||
},
|
||||
},
|
||||
// watch_video / listen_audio: unlike watch_percent (one aggregate figure across
|
||||
|
||||
Reference in New Issue
Block a user