(toolkitId: string, input: { readonly name?: string; readonly slug?: string })
| 323 | }); |
| 324 | |
| 325 | const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) => |
| 326 | Effect.gen(function* () { |
| 327 | const existing = yield* requireToolkit(toolkitId); |
| 328 | const name = input.name === undefined ? existing.data.name : input.name.trim(); |
| 329 | if (!name) return yield* fail("Toolkit name is required."); |
| 330 | const slug = |
| 331 | input.slug === undefined |
| 332 | ? existing.data.slug |
| 333 | : yield* normalizeSlugEffect({ name, slug: input.slug }); |
| 334 | yield* assertSlugAvailable(slug, toolkitId); |
| 335 | const entry = yield* storage.toolkits.put({ |
| 336 | owner: existing.owner, |
| 337 | key: toolkitId, |
| 338 | data: { ...existing.data, name, slug, updatedAt: Date.now() }, |
| 339 | }); |
| 340 | return toolkitToResponse(entry); |
| 341 | }); |
| 342 | |
| 343 | const remove = (toolkitId: string) => |
| 344 | Effect.gen(function* () { |
nothing calls this directly
no test coverage detected