type error fix maybe

This commit is contained in:
Kalle (Sendou)
2021-01-15 16:23:18 +02:00
parent 30646c3b6d
commit ba597ccdcb

View File

@@ -6,8 +6,8 @@ export type GetTeamData = Prisma.PromiseReturnType<typeof getTeam>;
export const getTeam = async (
where: { nameForUrl: string } | { id: number },
inviteCode: boolean = false
) =>
prisma.team.findUnique({
) => {
const team = await prisma.team.findUnique({
where,
select: {
id: true,
@@ -17,7 +17,7 @@ export const getTeam = async (
name: true,
captainId: true,
nameForUrl: true,
inviteCode,
inviteCode: true,
roster: {
select: {
id: true,
@@ -52,3 +52,6 @@ export const getTeam = async (
},
},
});
return inviteCode ? team : { ...team, inviteCode: null };
};