v0.7.4 bug fixes
This commit is contained in:
@@ -21,7 +21,14 @@ const PORT = process.env.PORT || 3000;
|
||||
// Init DB
|
||||
initDb();
|
||||
seedAdmin();
|
||||
getOrCreateSupportGroup(); // Ensure Support group exists
|
||||
// Ensure Support group exists and all admins are members
|
||||
const supportGroupId = getOrCreateSupportGroup();
|
||||
if (supportGroupId) {
|
||||
const db = getDb();
|
||||
const admins = db.prepare("SELECT id FROM users WHERE role = 'admin' AND status = 'active'").all();
|
||||
const insert = db.prepare('INSERT OR IGNORE INTO group_members (group_id, user_id) VALUES (?, ?)');
|
||||
for (const a of admins) insert.run(supportGroupId, a.id);
|
||||
}
|
||||
|
||||
// Middleware
|
||||
app.use(cors());
|
||||
|
||||
Reference in New Issue
Block a user