attempted upgrade

This commit is contained in:
yohlo
2025-09-24 00:13:41 -05:00
parent 94ea44c66e
commit e4164cbc71
26 changed files with 1390 additions and 1273 deletions

View File

@@ -13,14 +13,14 @@ export const listTournaments = createServerFn()
);
export const createTournament = createServerFn()
.validator(tournamentInputSchema)
.inputValidator(tournamentInputSchema)
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data }) =>
toServerResult(() => pbAdmin.createTournament(data))
);
export const updateTournament = createServerFn()
.validator(z.object({
.inputValidator(z.object({
id: z.string(),
updates: tournamentInputSchema.partial()
}))
@@ -30,7 +30,7 @@ export const updateTournament = createServerFn()
);
export const getTournament = createServerFn()
.validator(z.string())
.inputValidator(z.string())
.middleware([superTokensFunctionMiddleware])
.handler(async ({ data: tournamentId, context }) => {
const isAdmin = context.roles.includes("Admin");
@@ -44,7 +44,7 @@ export const getCurrentTournament = createServerFn()
);
export const enrollTeam = createServerFn()
.validator(z.object({
.inputValidator(z.object({
tournamentId: z.string(),
teamId: z.string()
}))
@@ -70,7 +70,7 @@ export const enrollTeam = createServerFn()
);
export const unenrollTeam = createServerFn()
.validator(z.object({
.inputValidator(z.object({
tournamentId: z.string(),
teamId: z.string()
}))
@@ -80,21 +80,21 @@ export const unenrollTeam = createServerFn()
);
export const getUnenrolledTeams = createServerFn()
.validator(z.string())
.inputValidator(z.string())
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data: tournamentId }) =>
toServerResult(() => pbAdmin.getUnenrolledTeams(tournamentId))
);
export const getFreeAgents = createServerFn()
.validator(z.string())
.inputValidator(z.string())
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data: tournamentId }) =>
toServerResult(() => pbAdmin.getFreeAgents(tournamentId))
);
export const enrollFreeAgent = createServerFn()
.validator(z.object({ phone: z.string(), tournamentId: z.string() }))
.inputValidator(z.object({ phone: z.string(), tournamentId: z.string() }))
.middleware([superTokensFunctionMiddleware])
.handler(async ({ context, data }) =>
toServerResult(async () => {
@@ -108,7 +108,7 @@ export const enrollFreeAgent = createServerFn()
);
export const unenrollFreeAgent = createServerFn()
.validator(z.object({ tournamentId: z.string() }))
.inputValidator(z.object({ tournamentId: z.string() }))
.middleware([superTokensFunctionMiddleware])
.handler(async ({ context, data }) =>
toServerResult(async () => {