mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-13 14:46:10 -05:00
Check that TO added user to team is not banned
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user