[create-pull-request] push formatted files

This commit is contained in:
Stefan-5422
2022-06-07 18:22:55 +00:00
committed by GitHub
parent 05d4c08ec2
commit 1a6c780de5
12 changed files with 222 additions and 210 deletions
+4 -6
View File
@@ -64,13 +64,13 @@ export const createParticipant = async (req: Request<{ teamPid: string }>, res:
try {
const discipline = await prisma.team.findUnique({
where: { pid: teamPid },
select: { discipline: true }
select: { discipline: true },
});
const maxteamsize = discipline?.discipline.maxTeamSize;
const userCount = await prisma.participant.count({
where: { team: { pid: teamPid } }
where: { team: { pid: teamPid } },
});
if (maxteamsize == userCount) {
@@ -88,7 +88,7 @@ export const createParticipant = async (req: Request<{ teamPid: string }>, res:
select: returnedParticipant,
});
return res.status(201).json({ type: "success", payload: { participant }, });
return res.status(201).json({ type: "success", payload: { participant } });
} catch (e) {
if (e instanceof PrismaClientKnownRequestError && e.code === "P2025") {
return res
@@ -176,9 +176,7 @@ export const deleteParticipant = async (req: Request<{ pid: string }>, res: Resp
};
export async function getGroupByParticipantPid(partPid: string) {
const parti = (
await prisma.participant.findUnique({ where: { pid: partPid }, select: { group: true } })
)?.group.pid;
const parti = (await prisma.participant.findUnique({ where: { pid: partPid }, select: { group: true } }))?.group.pid;
if (!parti) {
throw new NotFoundError("participant", partPid);