(
request: FastifyRequest<{ Params: { id: string } }>,
reply: FastifyReply
)
| 73 | } |
| 74 | |
| 75 | export async function getProject( |
| 76 | request: FastifyRequest<{ Params: { id: string } }>, |
| 77 | reply: FastifyReply |
| 78 | ) { |
| 79 | const project = await db.project.findFirst({ |
| 80 | where: { |
| 81 | id: request.params.id, |
| 82 | organizationId: request.client!.organizationId, |
| 83 | }, |
| 84 | }); |
| 85 | |
| 86 | if (!project) { |
| 87 | throw new HttpError('Project not found', { status: 404 }); |
| 88 | } |
| 89 | |
| 90 | reply.send({ data: project }); |
| 91 | } |
| 92 | |
| 93 | export async function createProject( |
| 94 | request: FastifyRequest<{ Body: z.infer<typeof zCreateProject> }>, |