(id: &Uuid)
| 63 | } |
| 64 | |
| 65 | pub async fn delete(id: &Uuid) -> Result<(), Error> { |
| 66 | let ra = diesel::delete(api_key::dsl::api_key.find(fields::Uuid::from(id))) |
| 67 | .execute(&mut get_async_db_conn().await?) |
| 68 | .await?; |
| 69 | if ra == 0 { |
| 70 | return Err(Error::NotFound(id.to_string())); |
| 71 | } |
| 72 | info!(id = %id, "Api-key deleted"); |
| 73 | Ok(()) |
| 74 | } |
| 75 | |
| 76 | pub async fn get_count(filters: &Filters) -> Result<i64, Error> { |
| 77 | let mut q = api_key::dsl::api_key |
no test coverage detected