(id: &Uuid)
| 119 | } |
| 120 | |
| 121 | pub async fn get(id: &Uuid) -> Result<ApiKey, Error> { |
| 122 | api_key::dsl::api_key |
| 123 | .find(fields::Uuid::from(id)) |
| 124 | .first(&mut get_async_db_conn().await?) |
| 125 | .await |
| 126 | .map_err(|e| error::Error::from_diesel(e, id.to_string())) |
| 127 | } |
| 128 | |
| 129 | pub async fn create_api_key(is_admin: bool, is_tenant: bool) -> ApiKey { |
| 130 | let ak = ApiKey { |
no test coverage detected