(dev_eui: &EUI64)
| 620 | } |
| 621 | |
| 622 | pub async fn delete(dev_eui: &EUI64) -> Result<(), Error> { |
| 623 | let ra = diesel::delete(device::dsl::device.find(&dev_eui)) |
| 624 | .execute(&mut get_async_db_conn().await?) |
| 625 | .await?; |
| 626 | if ra == 0 { |
| 627 | return Err(Error::NotFound(dev_eui.to_string())); |
| 628 | } |
| 629 | info!(dev_eui = %dev_eui, "Device deleted"); |
| 630 | Ok(()) |
| 631 | } |
| 632 | |
| 633 | pub async fn get_count(filters: &Filters) -> Result<i64, Error> { |
| 634 | let mut q = device::dsl::device |