(gateway_id: &EUI64)
| 277 | } |
| 278 | |
| 279 | pub async fn delete(gateway_id: &EUI64) -> Result<(), Error> { |
| 280 | let ra = diesel::delete(gateway::dsl::gateway.find(&gateway_id)) |
| 281 | .execute(&mut get_async_db_conn().await?) |
| 282 | .await?; |
| 283 | if ra == 0 { |
| 284 | return Err(Error::NotFound(gateway_id.to_string())); |
| 285 | } |
| 286 | info!( |
| 287 | gateway_id = %gateway_id, |
| 288 | "Gateway deleted" |
| 289 | ); |
| 290 | Ok(()) |
| 291 | } |
| 292 | |
| 293 | pub async fn get_count(filters: &Filters) -> Result<i64, Error> { |
| 294 | let mut q = gateway::dsl::gateway |