(patchId: string)
| 40 | }; |
| 41 | |
| 42 | export const findPatchById = async (patchId: string) => { |
| 43 | const result = await db.query.patch.findFirst({ |
| 44 | where: eq(patch.patchId, patchId), |
| 45 | }); |
| 46 | |
| 47 | if (!result) { |
| 48 | throw new TRPCError({ |
| 49 | code: "NOT_FOUND", |
| 50 | message: "Patch not found", |
| 51 | }); |
| 52 | } |
| 53 | |
| 54 | return result; |
| 55 | }; |
| 56 | |
| 57 | export const findPatchesByEntityId = async ( |
| 58 | id: string, |