(toolkitId: string, input: { readonly name?: string; readonly slug?: string })
| 369 | }); |
| 370 | |
| 371 | const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) => |
| 372 | Effect.gen(function* () { |
| 373 | const existing = yield* requireToolkit(toolkitId); |
| 374 | const name = input.name === undefined ? existing.data.name : input.name.trim(); |
| 375 | if (!name) return yield* fail("Toolkit name is required."); |
| 376 | const slug = |
| 377 | input.slug === undefined |
| 378 | ? existing.data.slug |
| 379 | : yield* normalizeSlugEffect({ name, slug: input.slug }); |
| 380 | yield* assertSlugAvailable(slug, toolkitId); |
| 381 | const entry = yield* storage.toolkits.put({ |
| 382 | owner: existing.owner, |
| 383 | key: toolkitId, |
| 384 | data: { ...existing.data, name, slug, updatedAt: Date.now() }, |
| 385 | }); |
| 386 | return toolkitToResponse(entry); |
| 387 | }); |
| 388 | |
| 389 | const remove = (toolkitId: string) => |
| 390 | Effect.gen(function* () { |
nothing calls this directly
no test coverage detected