(
input: RenameArtifactInput,
)
| 6212 | }); |
| 6213 | |
| 6214 | const artifactsRename = ( |
| 6215 | input: RenameArtifactInput, |
| 6216 | ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> => |
| 6217 | Effect.gen(function* () { |
| 6218 | const where = artifactById(input.id); |
| 6219 | const existing = yield* core.findFirst("artifact", { where }); |
| 6220 | if (!existing) { |
| 6221 | return yield* new ArtifactNotFoundError({ |
| 6222 | id: ArtifactId.make(input.id), |
| 6223 | }); |
| 6224 | } |
| 6225 | const set = { title: input.title, updated_at: new Date() }; |
| 6226 | yield* core.updateMany("artifact", { where, set }); |
| 6227 | return rowToArtifact({ ...existing, ...set }); |
| 6228 | }); |
| 6229 | |
| 6230 | // Hard delete: an artifact is not a connection, so there is no disabled or |
| 6231 | // archived state to fall back to. |
nothing calls this directly
no test coverage detected