From c4da3ee5708989cdd9bb9cc3c5bf2658d02d0daa Mon Sep 17 00:00:00 2001 From: Franklin Date: Fri, 26 Aug 2022 13:09:52 -0400 Subject: [PATCH] Added default app to userdtos --- src/dtos/user/user_dtos.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dtos/user/user_dtos.rs b/src/dtos/user/user_dtos.rs index b061890..dbf2475 100644 --- a/src/dtos/user/user_dtos.rs +++ b/src/dtos/user/user_dtos.rs @@ -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() } \ No newline at end of file