[web] Fix template path, return team lang in API
This commit is contained in:
parent
9482a1f46b
commit
63fa791d4a
@ -63,7 +63,7 @@ export async function createRepos(contestId: number) {
|
||||
return;
|
||||
}
|
||||
|
||||
const templateDir = join(dirname(fileURLToPath(import.meta.url)), '../../../../templates');
|
||||
const templateDir = join(dirname(fileURLToPath(import.meta.url)), '../../../templates');
|
||||
|
||||
contest.teams.forEach(async (team) => {
|
||||
fs.mkdirSync(team.id.toString(), { recursive: true });
|
||||
|
@ -5,16 +5,18 @@ import { db } from '$lib/server/prisma';
|
||||
export const GET = (async ({ params }) => {
|
||||
const session = params.session;
|
||||
const activeTeam = await db.activeTeam.findUnique({
|
||||
where: { sessionToken: session }
|
||||
where: { sessionToken: session },
|
||||
include: { team: { select: { language: true } } }
|
||||
});
|
||||
if (!activeTeam) {
|
||||
if (activeTeam === null) {
|
||||
return json({ success: false });
|
||||
}
|
||||
return json({
|
||||
success: true,
|
||||
data: {
|
||||
teamId: activeTeam.teamId,
|
||||
contestId: activeTeam.contestId
|
||||
contestId: activeTeam.contestId,
|
||||
language: activeTeam.team.language
|
||||
}
|
||||
});
|
||||
}) satisfies RequestHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user