mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-12 22:26:12 -05:00
Allow mod to ban users
This commit is contained in:
@@ -76,7 +76,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
|
||||
break;
|
||||
}
|
||||
case "BAN_USER": {
|
||||
validate(isAdmin(user), "Admin needed", 401);
|
||||
validate(isMod(user), "Mod needed", 401);
|
||||
|
||||
await AdminRepository.banUser({
|
||||
bannedReason: data.reason ?? null,
|
||||
@@ -89,7 +89,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
|
||||
break;
|
||||
}
|
||||
case "UNBAN_USER": {
|
||||
validate(isAdmin(user), "Admin needed", 401);
|
||||
validate(isMod(user), "Mod needed", 401);
|
||||
|
||||
await AdminRepository.unbanUser(data["user"]);
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ export default function AdminPage() {
|
||||
) : null}
|
||||
{isAdmin(user) ? <MigrateUser /> : null}
|
||||
{isAdmin(user) ? <ForcePatron /> : null}
|
||||
{isAdmin(user) ? <BanUser /> : null}
|
||||
{isAdmin(user) ? <UnbanUser /> : null}
|
||||
{isMod(user) ? <BanUser /> : null}
|
||||
{isMod(user) ? <UnbanUser /> : null}
|
||||
{isAdmin(user) ? <RefreshPlusTiers /> : null}
|
||||
{isAdmin(user) ? <CleanUp /> : null}
|
||||
</Main>
|
||||
|
||||
Reference in New Issue
Block a user