don't allow editing @everyone role
This commit is contained in:
parent
80c7eaa70f
commit
3c981b496b
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
import { Router, Request, Response } from "express";
|
||||
import { Member, partition } from "@spacebar/util";
|
||||
import { DiscordApiErrors, Member, partition } from "@spacebar/util";
|
||||
import { route } from "@spacebar/api";
|
||||
|
||||
const router = Router();
|
||||
@ -30,6 +30,9 @@ router.patch(
|
||||
const { guild_id, role_id } = req.params;
|
||||
const { member_ids } = req.body;
|
||||
|
||||
// don't mess with @everyone
|
||||
if (role_id == guild_id) throw DiscordApiErrors.INVALID_ROLE;
|
||||
|
||||
const members = await Member.find({
|
||||
where: { guild_id },
|
||||
relations: ["roles"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user