(serverId: string)
| 37 | }; |
| 38 | |
| 39 | export const findServerById = async (serverId: string) => { |
| 40 | const currentServer = await db.query.server.findFirst({ |
| 41 | where: eq(server.serverId, serverId), |
| 42 | with: { |
| 43 | deployments: true, |
| 44 | sshKey: true, |
| 45 | }, |
| 46 | }); |
| 47 | if (!currentServer) { |
| 48 | throw new TRPCError({ |
| 49 | code: "NOT_FOUND", |
| 50 | message: "Server not found", |
| 51 | }); |
| 52 | } |
| 53 | return currentServer; |
| 54 | }; |
| 55 | |
| 56 | export const findServersByUserId = async (userId: string) => { |
| 57 | const orgs = await db.query.organization.findMany({ |
no outgoing calls
no test coverage detected