(tenant_id: Uuid, relay_id: RelayId)
| 479 | } |
| 480 | |
| 481 | pub async fn get_relay_gateway(tenant_id: Uuid, relay_id: RelayId) -> Result<RelayGateway, Error> { |
| 482 | let relay = relay_gateway::dsl::relay_gateway |
| 483 | .find((fields::Uuid::from(tenant_id), &relay_id)) |
| 484 | .first(&mut get_async_db_conn().await?) |
| 485 | .await |
| 486 | .map_err(|e| Error::from_diesel(e, relay_id.to_string()))?; |
| 487 | Ok(relay) |
| 488 | } |
| 489 | |
| 490 | pub async fn update_relay_gateway(relay: RelayGateway) -> Result<RelayGateway, Error> { |
| 491 | let relay: RelayGateway = |