register form now has optional field role
This commit is contained in:
@@ -28,14 +28,16 @@ impl AuthClient {
|
||||
&mut self,
|
||||
username: String,
|
||||
email: String,
|
||||
password: Option<String>, // Use Option for optional fields
|
||||
password_confirmation: Option<String>, // Use Option for optional fields
|
||||
password: Option<String>,
|
||||
password_confirmation: Option<String>,
|
||||
role: Option<String>,
|
||||
) -> Result<AuthResponse, Box<dyn std::error::Error>> {
|
||||
let request = tonic::Request::new(RegisterRequest {
|
||||
username,
|
||||
email,
|
||||
password: password.unwrap_or_default(), // Send empty string if None
|
||||
password_confirmation: password_confirmation.unwrap_or_default(), // Send empty string if None
|
||||
password: password.unwrap_or_default(),
|
||||
password_confirmation: password_confirmation.unwrap_or_default(),
|
||||
role: role.unwrap_or_default(),
|
||||
});
|
||||
let response = self.client.register(request).await?.into_inner();
|
||||
Ok(response)
|
||||
|
||||
Reference in New Issue
Block a user