(app_id: Uuid)
| 215 | } |
| 216 | |
| 217 | pub async fn get_for_application_id(app_id: Uuid) -> Result<Tenant, Error> { |
| 218 | let t = tenant::dsl::tenant |
| 219 | .inner_join(application::table.on(application::tenant_id.eq(tenant::id))) |
| 220 | .select(tenant::all_columns) |
| 221 | .filter(application::id.eq(fields::Uuid::from(app_id))) |
| 222 | .first(&mut get_async_db_conn().await?) |
| 223 | .await |
| 224 | .map_err(|e| Error::from_diesel(e, app_id.to_string()))?; |
| 225 | |
| 226 | Ok(t) |
| 227 | } |
| 228 | |
| 229 | pub async fn update(t: Tenant) -> Result<Tenant, Error> { |
| 230 | t.validate()?; |
no test coverage detected