MCPcopy
hub / github.com/opactorai/Claudable / updateProjectServiceData

Function updateProjectServiceData

lib/services/project-services.ts:88–120  ·  view source on GitHub ↗
(
  projectId: string,
  provider: string,
  patch: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

86}
87
88export async function updateProjectServiceData(
89 projectId: string,
90 provider: string,
91 patch: Record<string, unknown>
92) {
93 const existing = await prisma.projectServiceConnection.findFirst({
94 where: { projectId, provider },
95 });
96
97 const nextData = {
98 ...(existing ? (existing.serviceData ? JSON.parse(existing.serviceData) : {}) : {}),
99 ...patch,
100 };
101
102 if (existing) {
103 const updated = await prisma.projectServiceConnection.update({
104 where: { id: existing.id },
105 data: { serviceData: serializeServiceData(nextData) },
106 });
107 return deserializeServiceData(updated);
108 }
109
110 const created = await prisma.projectServiceConnection.create({
111 data: {
112 projectId,
113 provider,
114 status: 'connected',
115 serviceData: serializeServiceData(nextData),
116 },
117 });
118
119 return deserializeServiceData(created);
120}

Callers 3

triggerVercelDeploymentFunction · 0.90
pushProjectToGitHubFunction · 0.90

Calls 2

serializeServiceDataFunction · 0.85
deserializeServiceDataFunction · 0.85

Tested by

no test coverage detected