various improvements, edit tournament, etc

This commit is contained in:
yohlo
2025-08-24 22:56:48 -05:00
parent 936ab0ce72
commit 2b8ccf1649
25 changed files with 504 additions and 52 deletions

View File

@@ -33,6 +33,24 @@ export const createTournament = createServerFn()
}
});
export const updateTournament = createServerFn()
.validator(z.object({
id: z.string(),
updates: tournamentInputSchema.partial()
}))
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data }) => {
try {
logger.info('Updating tournament', data);
const tournament = await pbAdmin.updateTournament(data.id, data.updates);
return tournament;
} catch (error) {
logger.error('Error updating tournament', error);
return null;
}
});
export const getTournament = createServerFn()
.validator(z.string())
.middleware([superTokensFunctionMiddleware])