( mountId: string, mountData: Partial<Mount>, )
| 224 | }; |
| 225 | |
| 226 | export const updateMount = async ( |
| 227 | mountId: string, |
| 228 | mountData: Partial<Mount>, |
| 229 | ) => { |
| 230 | const mount = await db.transaction(async (tx) => { |
| 231 | const mount = await tx |
| 232 | .update(mounts) |
| 233 | .set({ |
| 234 | ...mountData, |
| 235 | }) |
| 236 | .where(eq(mounts.mountId, mountId)) |
| 237 | .returning() |
| 238 | .then((value) => value[0]); |
| 239 | |
| 240 | if (!mount) { |
| 241 | throw new TRPCError({ |
| 242 | code: "NOT_FOUND", |
| 243 | message: "Mount not found", |
| 244 | }); |
| 245 | } |
| 246 | |
| 247 | return await findMountById(mountId); |
| 248 | }); |
| 249 | |
| 250 | if (mount.type === "file") { |
| 251 | await updateFileMount(mountId); |
| 252 | } |
| 253 | return mount; |
| 254 | }; |
| 255 | |
| 256 | export const findMountsByApplicationId = async ( |
| 257 | serviceId: string, |
no test coverage detected