fix sync usr to admin & fix notification plate & Rut Validation
This commit is contained in:
@@ -83,6 +83,10 @@ app.put('/api/plates/:id/approve', authenticateToken, isAdmin, async (req, res)
|
||||
where: { id: parseInt(id) },
|
||||
data: { status }
|
||||
});
|
||||
|
||||
// Notify Users via WebSocket
|
||||
io.emit('plate_status_updated', plate);
|
||||
|
||||
res.json(plate);
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: err.message });
|
||||
@@ -219,6 +223,10 @@ app.post('/api/people/bulk-approve', authenticateToken, isAdmin, async (req, res
|
||||
where: { addedById: parseInt(userId), status: 'PENDING' },
|
||||
data: { status: 'APPROVED' }
|
||||
});
|
||||
|
||||
// Notify Users via WebSocket
|
||||
io.emit('people_updated', { userId });
|
||||
|
||||
res.json({ message: 'Bulk approval successful' });
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: err.message });
|
||||
|
||||
Reference in New Issue
Block a user