MCPcopy
hub / github.com/Dokploy/dokploy / getServerId

Function getServerId

packages/server/src/services/mount.ts:394–421  ·  view source on GitHub ↗
(mount: MountNested)

Source from the content-addressed store, hash-verified

392
393type MountNested = Awaited<ReturnType<typeof findMountById>>;
394export 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};

Callers 3

createFileMountFunction · 0.85
updateFileMountFunction · 0.85
deleteFileMountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected