settings link, uneroll team server fn
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user