[create-pull-request] push formatted files

This commit is contained in:
stephan418
2022-05-30 19:59:00 +00:00
committed by GitHub
parent 04c3bc8f87
commit 5efb3597fd
4 changed files with 84 additions and 67 deletions
+24 -19
View File
@@ -102,7 +102,7 @@ export const updateRoleScore = async (req: Request<{ pid: string }, {}, { score:
const { score } = req.body;
if(typeof score !== "string"){
if (typeof score !== "string") {
res.status(400).json(generateInvalidBodyError({ score: DataType.STRING }));
}
@@ -115,40 +115,45 @@ export const updateRoleScore = async (req: Request<{ pid: string }, {}, { score:
select: {
pid: true,
score: true,
schema: { select: {
schema: {
select: {
pid: true,
name: true,
} },
participant: { select: {
pid: true,
firstName: true,
lastName: true,
} },
team: { select: {
pid: true,
name: true,
}}
}
},
},
participant: {
select: {
pid: true,
firstName: true,
lastName: true,
},
},
team: {
select: {
pid: true,
name: true,
},
},
},
});
res.status(200).json({
type: "success",
payload: {
role,
},
});
} catch (e) {
if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === "P2025") {
throw new NotFoundError("role", pid)
throw new NotFoundError("role", pid);
}
throw e;
}
}
};
export async function deleteRolesFromTeam(teamPid: string){
export async function deleteRolesFromTeam(teamPid: string) {
await prisma.role.deleteMany({
where: { team: { pid: teamPid, } }
where: { team: { pid: teamPid } },
});
}