mirror of
https://github.com/rmoren97/mc-manager.git
synced 2026-03-28 17:26:47 -07:00
fix: update server admin route
This commit is contained in:
parent
bb6844a20b
commit
82c73b4088
@ -39,10 +39,6 @@ export async function DELETE(
|
||||
return NextResponse.json({ error: 'User is not an admin of this server' }, { status: 404 })
|
||||
}
|
||||
|
||||
if (server.admins.length <= 1) {
|
||||
return NextResponse.json({ error: 'Cannot remove the last admin from a server' }, { status: 400 })
|
||||
}
|
||||
|
||||
const removedUser = await User.findById(userId, { username: 1 }).lean()
|
||||
|
||||
await Server.updateOne(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user