units,lesson as standalone

This commit is contained in:
2026-07-10 11:44:46 +08:00
parent 86fba50b95
commit e1ffdab190
46 changed files with 1463 additions and 197 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ async function list(req, res) {
order: [['createdAt', 'DESC']],
limit,
offset,
where: { show_in_notifications: true },
});
return R.success(res, 'Notifications fetched.', {
@@ -39,7 +40,7 @@ async function list(req, res) {
// ─── GET /admin/notifications/unseen ─────────────────────────────────────────
async function unseenCount(req, res) {
try {
const count = await AdminNotification.count({ where: { seen: false } });
const count = await AdminNotification.count({ where: { seen: false, show_in_notifications: true } });
return R.success(res, 'Unseen count fetched.', { count });
} catch (err) {
console.error('[NOTIFICATION] unseenCount error:', err);