File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
smbcloud-networking-account/src Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ pub mod login;
66pub mod oauth;
77pub mod project;
88pub mod repository;
9+ pub mod reset_password_response;
910pub mod runner;
1011pub mod signup;
1112
Original file line number Diff line number Diff line change 1+ use {
2+ serde:: { Deserialize , Serialize } ,
3+ tsync:: tsync,
4+ } ;
5+
6+ #[ derive( Debug , Serialize , Deserialize ) ]
7+ #[ tsync]
8+ pub struct ResetPasswordResponse {
9+ pub code : Option < i32 > ,
10+ pub message : String ,
11+ }
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ pub async fn parse_error_response<T: DeserializeOwned>(
7171 println ! ( ) ;
7272 }
7373
74- let error_response = match serde_json:: from_str :: < T > ( & error_response_body) {
74+ let error_response = match serde_json:: from_str ( & error_response_body) {
7575 Ok ( error_response) => error_response,
7676 Err ( e) => {
7777 error ! ( "Failed to parse error response: {:?}" , e) ;
@@ -82,7 +82,8 @@ pub async fn parse_error_response<T: DeserializeOwned>(
8282 }
8383 } ;
8484 // The parsing itself is succeed.
85- Ok ( error_response)
85+ // Why is this an ErrorResponse.
86+ Err ( error_response)
8687}
8788
8889pub async fn request_login ( builder : RequestBuilder ) -> Result < AccountStatus , ErrorResponse > {
Original file line number Diff line number Diff line change 33 smbcloud_model:: {
44 error_codes:: ErrorResponse ,
55 forgot:: { Param , UserUpdatePassword } ,
6+ reset_password_response:: ResetPasswordResponse ,
67 } ,
78 smbcloud_network:: { environment:: Environment , network:: request} ,
89 smbcloud_networking:: {
@@ -15,7 +16,7 @@ pub async fn reset_password(
1516 client : SmbClient ,
1617 token : String ,
1718 password : String ,
18- ) -> Result < ( ) , ErrorResponse > {
19+ ) -> Result < ResetPasswordResponse , ErrorResponse > {
1920 let password_confirmation = password. clone ( ) ;
2021 let params = Param {
2122 user : UserUpdatePassword {
You can’t perform that action at this time.
0 commit comments