Function
assertSlugAvailable
(slug: string, ignoreToolkitId?: string)
Source from the content-addressed store, hash-verified
| 263 | ); |
| 264 | |
| 265 | const assertSlugAvailable = (slug: string, ignoreToolkitId?: string) => |
| 266 | storage.toolkits.query({ where: { slug } }).pipe( |
| 267 | Effect.flatMap((entries) => { |
| 268 | const collision = entries.find((entry) => entry.data.id !== ignoreToolkitId); |
| 269 | return collision ? fail(`Toolkit slug "${slug}" is already in use.`) : Effect.void; |
| 270 | }), |
| 271 | ); |
| 272 | |
| 273 | const listPoliciesForRecord = (toolkitId: string) => |
| 274 | storage.policies |
Tested by
no test coverage detected