diff --git a/src/methods/discord.rs b/src/methods/discord.rs index a8f7648..1c32e78 100644 --- a/src/methods/discord.rs +++ b/src/methods/discord.rs @@ -7,6 +7,7 @@ use tide::{ pub mod account { use super::*; + use serde::Serialize; #[derive(Debug, Deserialize)] struct Auth { @@ -30,7 +31,13 @@ pub mod account { Ok(json!(result).into()) } - pub async fn get_wolves_mail(db: &Pool) -> Vec { + #[derive(Debug, Deserialize, Serialize)] + pub struct DiscordResult { + discord: String, + email: String, + } + + pub async fn get_wolves_mail(db: &Pool) -> Vec { let results = sqlx::query_as::<_, Accounts>( r#" SELECT * @@ -46,7 +53,10 @@ pub mod account { for item in results { if let Some(discord) = item.discord { - result.push(discord); + result.push(DiscordResult { + discord, + email: item.mail, + }); } }