(id: string)
| 32 | * Retrieve project by ID |
| 33 | */ |
| 34 | export async function getProjectById(id: string): Promise<Project | null> { |
| 35 | const project = await prisma.project.findUnique({ |
| 36 | where: { id }, |
| 37 | }); |
| 38 | if (!project) return null; |
| 39 | return { |
| 40 | ...project, |
| 41 | selectedModel: normalizeModelId(project.preferredCli ?? 'claude', project.selectedModel ?? undefined), |
| 42 | } as Project; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Create new project |
no test coverage detected