(
application_id: &Uuid,
kind: IntegrationKind,
)
| 516 | } |
| 517 | |
| 518 | pub async fn get_integration( |
| 519 | application_id: &Uuid, |
| 520 | kind: IntegrationKind, |
| 521 | ) -> Result<Integration, Error> { |
| 522 | let i: Integration = application_integration::dsl::application_integration |
| 523 | .filter( |
| 524 | application_integration::dsl::application_id |
| 525 | .eq(fields::Uuid::from(application_id)) |
| 526 | .and(application_integration::dsl::kind.eq(kind)), |
| 527 | ) |
| 528 | .first(&mut get_async_db_conn().await?) |
| 529 | .await |
| 530 | .map_err(|e| Error::from_diesel(e, application_id.to_string()))?; |
| 531 | |
| 532 | Ok(i) |
| 533 | } |
| 534 | |
| 535 | pub async fn update_integration(i: Integration) -> Result<Integration, Error> { |
| 536 | let i: Integration = diesel::update( |
no test coverage detected