asset viewer now viewing on tabs

Tabs is better for this yay

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-28 19:34:10 +08:00
parent 5b784ca87c
commit 05f27e34d7
26 changed files with 1679 additions and 351 deletions
+34
View File
@@ -0,0 +1,34 @@
const { Course } = require('../../api/models/courses/courses.mdl');
const Unit = require('../../api/models/courses/units.mdl');
const Lesson = require('../../api/models/courses/lessons.mdl');
const { TaskList, Task } = require('../../api/models/task/task.mdl');
const Advertisement = require('../../api/models/advertisements/advertisements.mdl');
const TierPlan = require('../../api/models/tiers/tier_plans.mdl');
const { Op } = require('sequelize');
const QA_PREFIX = '[QA-TEST';
const TARGETS = [
{ model: Task, column: 'name' },
{ model: TaskList, column: 'name' },
{ model: Advertisement, column: 'headline' },
{ model: Unit, column: 'title' },
{ model: Lesson, column: 'title' },
{ model: Course, column: 'title' },
{ model: TierPlan, column: 'label' },
];
/** Hard-deletes every QA-TEST-prefixed fixture row across all modules this suite touches. */
async function cleanupQaTestFixtures() {
const removed = {};
for (const { model, column } of TARGETS) {
const count = await model.destroy({
where: { [column]: { [Op.like]: `${QA_PREFIX}%` } },
force: true, // hard delete, not just paranoid soft-delete — mirrors the manual "archive then permanently delete" cleanup flow
});
if (count) removed[model.name] = count;
}
return removed;
}
module.exports = { cleanupQaTestFixtures, QA_PREFIX };