Added default app to userdtos

This commit is contained in:
Franklin 2022-08-26 13:09:52 -04:00
parent c7a33999ca
commit c4da3ee570
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@ use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct UserForCreationDto{
#[serde(default = "get_default_app")]
pub app: String,
pub email: String,
pub password: String,
@ -9,13 +10,19 @@ pub struct UserForCreationDto{
}
#[derive(Serialize, Deserialize, Debug)]
pub struct UserForLoginDto{
#[serde(default = "get_default_app")]
pub app: String,
pub email: String,
pub password: String
}
#[derive(Serialize, Deserialize, Debug)]
pub struct UserForAuthenticationDto{
#[serde(default = "get_default_app")]
pub app: String,
pub email: String,
pub token: String
}
fn get_default_app() -> String {
"deez".to_string()
}