(
input: RenameArtifactInput,
)
| 4043 | }); |
| 4044 | |
| 4045 | const artifactsRename = ( |
| 4046 | input: RenameArtifactInput, |
| 4047 | ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> => |
| 4048 | Effect.gen(function* () { |
| 4049 | const where = artifactById(input.id); |
| 4050 | const existing = yield* core.findFirst("artifact", { where }); |
| 4051 | if (!existing) { |
| 4052 | return yield* new ArtifactNotFoundError({ id: ArtifactId.make(input.id) }); |
| 4053 | } |
| 4054 | const set = { title: input.title, updated_at: new Date() }; |
| 4055 | yield* core.updateMany("artifact", { where, set }); |
| 4056 | return rowToArtifact({ ...existing, ...set }); |
| 4057 | }); |
| 4058 | |
| 4059 | // Hard delete: an artifact is not a connection, so there is no disabled or |
| 4060 | // archived state to fall back to. |
nothing calls this directly
no test coverage detected