Fix
This commit is contained in:
1 parent
5f86950dba
commit
e1a54fa86b
3 files changed
+348
-64
No files matched your search
@@ -46,7 +46,9 @@ router.post('/broadcast', requireAdmin, (req, res) => {
|
||||
);
|
||||
|
||||
let targets;
|
||||
if (user_id) {
|
||||
if (user_id === 'admins') {
|
||||
targets = db.prepare("SELECT id FROM users WHERE role = 'admin'").all();
|
||||
} else if (user_id) {
|
||||
const u = db.prepare('SELECT id FROM users WHERE id = ?').get(user_id);
|
||||
if (!u) return res.status(404).json({ error: 'Utilisateur introuvable' });
|
||||
targets = [u];
|
||||
|
||||
Reference in new issue
Block a user