mirror of
https://github.com/detleph/server.git
synced 2026-09-07 23:44:40 +02:00
small fixes
This commit is contained in:
@@ -7,7 +7,6 @@ import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
|
|||||||
import NotFoundError from "../Middleware/error/NotFoundError";
|
import NotFoundError from "../Middleware/error/NotFoundError";
|
||||||
|
|
||||||
//TODO: add TeamleaderAuthentification
|
//TODO: add TeamleaderAuthentification
|
||||||
// discuss wether
|
|
||||||
|
|
||||||
const ParticipantBody = z.object({
|
const ParticipantBody = z.object({
|
||||||
firstName: z.string(),
|
firstName: z.string(),
|
||||||
@@ -16,10 +15,8 @@ const ParticipantBody = z.object({
|
|||||||
job: z.enum(["TEAMLEADER", "MEMBER"]),
|
job: z.enum(["TEAMLEADER", "MEMBER"]),
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateParticipantBody = ParticipantBody.pick({
|
const updateParticipantBody = ParticipantBody.omit({
|
||||||
firstName: true,
|
job: true,
|
||||||
lastName: true,
|
|
||||||
groupId: true,
|
|
||||||
}).partial();
|
}).partial();
|
||||||
|
|
||||||
const returnedParticipant = {
|
const returnedParticipant = {
|
||||||
@@ -27,8 +24,14 @@ const returnedParticipant = {
|
|||||||
firstName: true,
|
firstName: true,
|
||||||
lastName: true,
|
lastName: true,
|
||||||
relevance: true,
|
relevance: true,
|
||||||
team: { select: { pid: true, } },
|
team: { select: {
|
||||||
group: { select: { pid: true, } },
|
pid: true,
|
||||||
|
name: true,
|
||||||
|
} },
|
||||||
|
group: { select: {
|
||||||
|
pid: true,
|
||||||
|
name: true,
|
||||||
|
} },
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const createParticipant = async (req: Request<{ pid: string}>, res: Response) => {
|
export const createParticipant = async (req: Request<{ pid: string}>, res: Response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user