Added default app to userdtos

This commit is contained in:
Franklin 2022-08-26 13:09:52 -04:00
parent c7a33999ca
commit c4da3ee570

View File

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