feat: allow promoting users to admin role
This commit is contained in:
+2
-2
@@ -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' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user