MCPcopy Create free account
hub / github.com/ShipSecAI/studio / update

Function update

backend/src/workflows/__tests__/workflows.controller.spec.ts:190–208  ·  view source on GitHub ↗
(id, input, options: RepositoryOptions = {})

Source from the content-addressed store, hash-verified

188 return record;
189 },
190 async update(id, input, options: RepositoryOptions = {}) {
191 const existing = repositoryStore.get(id);
192 if (!existing) {
193 throw new Error(`Workflow ${id} not found`);
194 }
195 if (options.organizationId && existing.organizationId !== options.organizationId) {
196 throw new Error('Forbidden');
197 }
198 const updated: WorkflowRecord = {
199 ...existing,
200 name: input.name,
201 description: input.description ?? null,
202 graph: input,
203 updatedAt: new Date(),
204 compiledDefinition: existing.compiledDefinition,
205 };
206 repositoryStore.set(id, updated);
207 return updated;
208 },
209 async findById(id, options: RepositoryOptions = {}) {
210 const record = repositoryStore.get(id);
211 if (!record) return undefined;

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected