mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 07:32:19 -05:00
Check that TO added user to team is not banned
This commit is contained in:
parent
09c0ed322b
commit
6a188a1d69
|
|
@ -39,6 +39,7 @@ import { useTournament } from "./to.$id";
|
|||
import { findMapPoolByTeamId } from "~/features/tournament-bracket/queries/findMapPoolByTeamId.server";
|
||||
import { Input } from "~/components/Input";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { userIsBanned } from "~/features/ban/core/banned.server";
|
||||
|
||||
export const action: ActionFunction = async ({ request, params }) => {
|
||||
const user = await requireUserId(request);
|
||||
|
|
@ -211,6 +212,11 @@ export const action: ActionFunction = async ({ request, params }) => {
|
|||
validate(!previousTeam, "User is already on a team");
|
||||
}
|
||||
|
||||
validate(
|
||||
!userIsBanned(data.userId),
|
||||
"User trying to be added currently has an active ban from sendou.ink",
|
||||
);
|
||||
|
||||
joinTeam({
|
||||
userId: data.userId,
|
||||
newTeamId: team.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user