Returns the artifact with the given id if it exists.
(&self, input: GetArtifactInput)
| 32 | |
| 33 | /// Returns the artifact with the given id if it exists. |
| 34 | pub async fn get_artifact(&self, input: GetArtifactInput) -> ApiResult<GetArtifactResponse> { |
| 35 | let artifact = self.artifact_service.find_by_id( |
| 36 | HelperMapper::to_uuid(input.artifact_id) |
| 37 | .expect("Invalid artifact id") |
| 38 | .as_bytes(), |
| 39 | )?; |
| 40 | |
| 41 | Ok(GetArtifactResponse { |
| 42 | artifact: artifact.into(), |
| 43 | }) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | #[cfg(test)] |