feat: allow promoting users to admin role

This commit is contained in:
Mohan Ki
2026-07-27 16:45:23 +05:30
parent dc5ecd4efb
commit df8b49f387
+2 -2
View File
@@ -27,9 +27,9 @@ router.get('/users', async (req, res) => {
// Update a user's tier // Update a user's tier
router.put('/users/:id/tier', async (req, res) => { router.put('/users/:id/tier', async (req, res) => {
const { id } = req.params; const { id } = req.params;
const { role } = req.body; // 'free', 'pro', 'enterprise' const { role } = req.body; // 'free', 'pro', 'enterprise', 'admin'
if (!['free', 'pro', 'enterprise'].includes(role)) { if (!['free', 'pro', 'enterprise', 'admin'].includes(role)) {
return res.status(400).json({ error: 'Invalid role specified' }); return res.status(400).json({ error: 'Invalid role specified' });
} }