settings link, uneroll team server fn

This commit is contained in:
yohlo
2025-08-24 00:35:38 -05:00
parent 53276cc18e
commit 324e1742f1
9 changed files with 112 additions and 14 deletions

View File

@@ -70,3 +70,20 @@ export const enrollTeam = createServerFn()
throw error;
}
});
export const unenrollTeam = createServerFn()
.validator(z.object({
tournamentId: z.string(),
teamId: z.string()
}))
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data: { tournamentId, teamId }, context }) => {
try {
logger.info('Enrolling team in tournament', { tournamentId, teamId, context });
const tournament = await pbAdmin.unenrollTeam(tournamentId, teamId);
return tournament;
} catch (error) {
logger.error('Error enrolling team', error);
throw error;
}
});