(id: &Uuid)
| 368 | } |
| 369 | |
| 370 | pub async fn delete(id: &Uuid) -> Result<(), Error> { |
| 371 | let ra = diesel::delete(device_profile::dsl::device_profile.find(&fields::Uuid::from(id))) |
| 372 | .execute(&mut get_async_db_conn().await?) |
| 373 | .await?; |
| 374 | if ra == 0 { |
| 375 | return Err(error::Error::NotFound(id.to_string())); |
| 376 | } |
| 377 | info!(id = %id, "Device-profile deleted"); |
| 378 | Ok(()) |
| 379 | } |
| 380 | |
| 381 | pub async fn get_count(filters: &Filters) -> Result<i64, Error> { |
| 382 | let mut q = device_profile::table |