(mount: MountNested)
| 392 | |
| 393 | type MountNested = Awaited<ReturnType<typeof findMountById>>; |
| 394 | export const getServerId = async (mount: MountNested) => { |
| 395 | if (mount.serviceType === "application" && mount?.application?.serverId) { |
| 396 | return mount.application.serverId; |
| 397 | } |
| 398 | if (mount.serviceType === "postgres" && mount?.postgres?.serverId) { |
| 399 | return mount.postgres.serverId; |
| 400 | } |
| 401 | if (mount.serviceType === "mariadb" && mount?.mariadb?.serverId) { |
| 402 | return mount.mariadb.serverId; |
| 403 | } |
| 404 | if (mount.serviceType === "mongo" && mount?.mongo?.serverId) { |
| 405 | return mount.mongo.serverId; |
| 406 | } |
| 407 | if (mount.serviceType === "mysql" && mount?.mysql?.serverId) { |
| 408 | return mount.mysql.serverId; |
| 409 | } |
| 410 | if (mount.serviceType === "redis" && mount?.redis?.serverId) { |
| 411 | return mount.redis.serverId; |
| 412 | } |
| 413 | if (mount.serviceType === "compose" && mount?.compose?.serverId) { |
| 414 | return mount.compose.serverId; |
| 415 | } |
| 416 | if (mount.serviceType === "libsql" && mount?.libsql?.serverId) { |
| 417 | return mount.libsql.serverId; |
| 418 | } |
| 419 | |
| 420 | return null; |
| 421 | }; |
no outgoing calls
no test coverage detected