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

Function updateProject

lib/services/project.ts:81–110  ·  view source on GitHub ↗
(
  id: string,
  input: UpdateProjectInput
)

Source from the content-addressed store, hash-verified

79 * Update project
80 */
81export async function updateProject(
82 id: string,
83 input: UpdateProjectInput
84): Promise<Project> {
85 const existing = await prisma.project.findUnique({
86 where: { id },
87 select: { preferredCli: true },
88 });
89 const targetCli = input.preferredCli ?? existing?.preferredCli ?? 'claude';
90 const normalizedModel = input.selectedModel
91 ? normalizeModelId(targetCli, input.selectedModel)
92 : undefined;
93
94 const project = await prisma.project.update({
95 where: { id },
96 data: {
97 ...input,
98 ...(input.selectedModel
99 ? { selectedModel: normalizedModel }
100 : {}),
101 updatedAt: new Date(),
102 },
103 });
104
105 console.log(`[ProjectService] Updated project: ${id}`);
106 return {
107 ...project,
108 selectedModel: normalizeModelId(project.preferredCli ?? 'claude', project.selectedModel ?? undefined),
109 } as Project;
110}
111
112/**
113 * Delete project

Callers 7

connectProjectToGitHubFunction · 0.90
startMethod · 0.90
stopMethod · 0.90
executeClaudeFunction · 0.90
runCursorOnceFunction · 0.90
POSTFunction · 0.90
PUTFunction · 0.90

Calls 1

normalizeModelIdFunction · 0.90

Tested by

no test coverage detected