(
input: RenameArtifactInput,
)
| 6093 | }); |
| 6094 | |
| 6095 | const artifactsRename = ( |
| 6096 | input: RenameArtifactInput, |
| 6097 | ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> => |
| 6098 | Effect.gen(function* () { |
| 6099 | const where = artifactById(input.id); |
| 6100 | const existing = yield* core.findFirst("artifact", { where }); |
| 6101 | if (!existing) { |
| 6102 | return yield* new ArtifactNotFoundError({ |
| 6103 | id: ArtifactId.make(input.id), |
| 6104 | }); |
| 6105 | } |
| 6106 | const set = { title: input.title, updated_at: new Date() }; |
| 6107 | yield* core.updateMany("artifact", { where, set }); |
| 6108 | return rowToArtifact({ ...existing, ...set }); |
| 6109 | }); |
| 6110 | |
| 6111 | // Hard delete: an artifact is not a connection, so there is no disabled or |
| 6112 | // archived state to fall back to. |
nothing calls this directly
no test coverage detected