Give patrons access to tournaments beta

This commit is contained in:
Kalle 2024-12-22 12:50:49 +02:00
parent 2b984f0169
commit efd1d75318
4 changed files with 15 additions and 3 deletions

View File

@ -96,8 +96,8 @@ export default function CalendarNewEventPage() {
return (
<Main className="stack items-center">
<Alert variation="WARNING">
No permissions to add tournaments. Access to tournaments beta can be
applied from Discord helpdesk for established TO&apos;s.
No permissions to add tournaments. Tournaments are in beta, accessible
by Patreon supporters and established TO&apos;s.
</Alert>
</Main>
);

View File

@ -93,6 +93,11 @@ const PERKS = [
name: "joinFive",
extraInfo: false,
},
{
tier: 2,
name: "tournamentsBeta",
extraInfo: false,
},
] as const;
export default function SupportPage() {

View File

@ -263,6 +263,12 @@ export function findBannedStatusByUserId(userId: number) {
.executeTakeFirst();
}
const userIsTournamentOrganizer = sql<
string | null
>`IIF(COALESCE("User"."patronTier", 0) >= 2, 1, "User"."isTournamentOrganizer")`.as(
"isTournamentOrganizer",
);
export function findLeanById(id: number) {
return db
.selectFrom("User")
@ -272,7 +278,7 @@ export function findLeanById(id: number) {
...COMMON_USER_FIELDS,
"User.isArtist",
"User.isVideoAdder",
"User.isTournamentOrganizer",
userIsTournamentOrganizer,
"User.patronTier",
"User.favoriteBadgeId",
"User.languages",

View File

@ -196,6 +196,7 @@
"support.perk.prioritySupport.extra": "Access to a separate helpdesk that I prioritize for support requests",
"support.perk.previewQ": "Preview groups in SendouQ before joining",
"support.perk.joinFive": "Join up to 5 teams",
"support.perk.tournamentsBeta": "Access to tournaments beta",
"custom.colors.title": "Custom colors",
"custom.colors.bg": "Background",