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

Function getServiceOrganizationId

apps/dokploy/server/api/routers/mount.ts:34–74  ·  view source on GitHub ↗
(
	serviceId: string,
	serviceType: ServiceType,
)

Source from the content-addressed store, hash-verified

32import { createTRPCRouter, protectedProcedure } from "../trpc";
33
34async function getServiceOrganizationId(
35 serviceId: string,
36 serviceType: ServiceType,
37): Promise<string | null> {
38 switch (serviceType) {
39 case "application": {
40 const app = await findApplicationById(serviceId);
41 return app?.environment?.project?.organizationId ?? null;
42 }
43 case "postgres": {
44 const postgres = await findPostgresById(serviceId);
45 return postgres?.environment?.project?.organizationId ?? null;
46 }
47 case "mariadb": {
48 const mariadb = await findMariadbById(serviceId);
49 return mariadb?.environment?.project?.organizationId ?? null;
50 }
51 case "mongo": {
52 const mongo = await findMongoById(serviceId);
53 return mongo?.environment?.project?.organizationId ?? null;
54 }
55 case "mysql": {
56 const mysql = await findMySqlById(serviceId);
57 return mysql?.environment?.project?.organizationId ?? null;
58 }
59 case "redis": {
60 const redis = await findRedisById(serviceId);
61 return redis?.environment?.project?.organizationId ?? null;
62 }
63 case "compose": {
64 const compose = await findComposeById(serviceId);
65 return compose?.environment?.project?.organizationId ?? null;
66 }
67 case "libsql": {
68 const libsql = await findLibsqlById(serviceId);
69 return libsql?.environment?.project?.organizationId ?? null;
70 }
71 default:
72 return null;
73 }
74}
75
76export const mountRouter = createTRPCRouter({
77 create: protectedProcedure

Callers 1

mount.tsFile · 0.85

Calls 8

findApplicationByIdFunction · 0.90
findPostgresByIdFunction · 0.90
findMariadbByIdFunction · 0.90
findMongoByIdFunction · 0.90
findMySqlByIdFunction · 0.90
findRedisByIdFunction · 0.90
findComposeByIdFunction · 0.90
findLibsqlByIdFunction · 0.90

Tested by

no test coverage detected