Skip to content

Commit

Permalink
fix: display current week in points page too
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Jan 16, 2024
1 parent bf7fb18 commit 9fbff05
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/controllers/Team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ export const GetTeamHandler = async (req: any, rep: any) => {
}

export const GetPointsTeamHandler = async (req: any, rep: any) => {
const team = await prisma.team.findUnique({
where: {
id: +req.params.id,
}
});
if(!team) {
rep.status(404);
}
const players = await prisma.player.findMany({
include: {
selections: {
Expand All @@ -150,18 +158,13 @@ export const GetPointsTeamHandler = async (req: any, rep: any) => {
},
where: {
selections: {
some: {
every: {
teamId: +req.params.id,
weekId: +req.params.weekId,
}
}
}
});
const team = await prisma.team.findUnique({
where: {
id: +req.params.id,
}
});
const deadlineWeek = await prisma.week.findFirst({
where: {
id: +req.params.weekId
Expand Down

0 comments on commit 9fbff05

Please sign in to comment.