dbg: excessive logging
This commit is contained in:
parent
eee6a76c69
commit
1c176d4f73
1 changed files with 21 additions and 6 deletions
27
src/lib.rs
27
src/lib.rs
|
@ -1,3 +1,4 @@
|
|||
use std::num::ParseIntError;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// This is what Wolves returns to us
|
||||
|
@ -201,6 +202,7 @@ impl Client {
|
|||
/// # })
|
||||
/// ```
|
||||
pub async fn get_member(self, email: &str) -> Option<i64> {
|
||||
dbg!(&self.base_key);
|
||||
// if the key isnt set then we cant do anything.
|
||||
let api_key = match &self.base_key {
|
||||
None => {
|
||||
|
@ -210,7 +212,7 @@ impl Client {
|
|||
};
|
||||
|
||||
let url = format!("{}/get_id_from_email", &self.base_wolves);
|
||||
|
||||
dbg!(&url);
|
||||
match reqwest::Client::new()
|
||||
.post(&url)
|
||||
.form(&[("email", email)])
|
||||
|
@ -219,13 +221,26 @@ impl Client {
|
|||
.await
|
||||
{
|
||||
Ok(x) => {
|
||||
if let Ok(y) = x.json::<WolvesResultSingle<WolvesUserExists>>().await {
|
||||
// this is the only time we will get a positive response, the None at the end catches everything else
|
||||
if let WolvesUserExists::S(z) = y.result {
|
||||
if let Ok(id) = z.parse::<i64>() {
|
||||
return Some(id);
|
||||
match x.json::<WolvesResultSingle<WolvesUserExists>>().await {
|
||||
Ok(y) => {
|
||||
// this is the only time we will get a positive response, the None at the end catches everything else
|
||||
match y.result {
|
||||
WolvesUserExists::B(e) => {dbg!(e);}
|
||||
WolvesUserExists::S(z) => {
|
||||
match z.parse::<i64>() {
|
||||
Ok(id) => {
|
||||
return Some(id);
|
||||
}
|
||||
Err(e) => {
|
||||
dbg!(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
dbg!(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
Loading…
Reference in a new issue