(
input: RenameArtifactInput,
)
| 4586 | }); |
| 4587 | |
| 4588 | const artifactsRename = ( |
| 4589 | input: RenameArtifactInput, |
| 4590 | ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> => |
| 4591 | Effect.gen(function* () { |
| 4592 | const where = artifactById(input.id); |
| 4593 | const existing = yield* core.findFirst("artifact", { where }); |
| 4594 | if (!existing) { |
| 4595 | return yield* new ArtifactNotFoundError({ id: ArtifactId.make(input.id) }); |
| 4596 | } |
| 4597 | const set = { title: input.title, updated_at: new Date() }; |
| 4598 | yield* core.updateMany("artifact", { where, set }); |
| 4599 | return rowToArtifact({ ...existing, ...set }); |
| 4600 | }); |
| 4601 | |
| 4602 | // Hard delete: an artifact is not a connection, so there is no disabled or |
| 4603 | // archived state to fall back to. |
nothing calls this directly
no test coverage detected