(
input: RenameArtifactInput,
)
| 4156 | }); |
| 4157 | |
| 4158 | const artifactsRename = ( |
| 4159 | input: RenameArtifactInput, |
| 4160 | ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> => |
| 4161 | Effect.gen(function* () { |
| 4162 | const where = artifactById(input.id); |
| 4163 | const existing = yield* core.findFirst("artifact", { where }); |
| 4164 | if (!existing) { |
| 4165 | return yield* new ArtifactNotFoundError({ id: ArtifactId.make(input.id) }); |
| 4166 | } |
| 4167 | const set = { title: input.title, updated_at: new Date() }; |
| 4168 | yield* core.updateMany("artifact", { where, set }); |
| 4169 | return rowToArtifact({ ...existing, ...set }); |
| 4170 | }); |
| 4171 | |
| 4172 | // Hard delete: an artifact is not a connection, so there is no disabled or |
| 4173 | // archived state to fall back to. |
nothing calls this directly
no test coverage detected