Function
assertSlugAvailable
(slug: string, ignoreToolkitId?: string)
Source from the content-addressed store, hash-verified
| 309 | ); |
| 310 | |
| 311 | const assertSlugAvailable = (slug: string, ignoreToolkitId?: string) => |
| 312 | storage.toolkits.query({ where: { slug } }).pipe( |
| 313 | Effect.flatMap((entries) => { |
| 314 | const collision = entries.find((entry) => entry.data.id !== ignoreToolkitId); |
| 315 | return collision ? fail(`Toolkit slug "${slug}" is already in use.`) : Effect.void; |
| 316 | }), |
| 317 | ); |
| 318 | |
| 319 | const listPoliciesForRecord = (toolkitId: string) => |
| 320 | storage.policies |
Tested by
no test coverage detected