(projectId: string)
| 48 | }; |
| 49 | |
| 50 | export const findProjectById = async (projectId: string) => { |
| 51 | const project = await db.query.projects.findFirst({ |
| 52 | where: eq(projects.projectId, projectId), |
| 53 | with: { |
| 54 | environments: { |
| 55 | with: { |
| 56 | applications: true, |
| 57 | compose: true, |
| 58 | libsql: true, |
| 59 | mariadb: true, |
| 60 | mongo: true, |
| 61 | mysql: true, |
| 62 | postgres: true, |
| 63 | redis: true, |
| 64 | }, |
| 65 | }, |
| 66 | projectTags: { |
| 67 | with: { |
| 68 | tag: true, |
| 69 | }, |
| 70 | }, |
| 71 | }, |
| 72 | }); |
| 73 | if (!project) { |
| 74 | throw new TRPCError({ |
| 75 | code: "NOT_FOUND", |
| 76 | message: "Project not found", |
| 77 | }); |
| 78 | } |
| 79 | return project; |
| 80 | }; |
| 81 | |
| 82 | export const deleteProject = async (projectId: string) => { |
| 83 | const project = await db |
no outgoing calls
no test coverage detected