mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 10:38:20 +00:00
Make User create comment Optional
This commit is contained in:
parent
4edc1a494f
commit
9dcd861a29
1 changed files with 5 additions and 2 deletions
|
@ -15,7 +15,7 @@ pub fn get_users(_: Params, state: &RpcState) -> Result<HashMap<String, User>, A
|
|||
struct CreateUser {
|
||||
name: String,
|
||||
password: String,
|
||||
comment: String,
|
||||
comment: Option<String>,
|
||||
}
|
||||
|
||||
pub fn create_user(p: Params, state: &RpcState) -> Result<(), ApiError> {
|
||||
|
@ -33,7 +33,10 @@ pub fn create_user(p: Params, state: &RpcState) -> Result<(), ApiError> {
|
|||
.insert(
|
||||
u.name,
|
||||
User {
|
||||
comment: u.comment,
|
||||
comment: match u.comment {
|
||||
Some(c) => c,
|
||||
None => "".to_string(),
|
||||
},
|
||||
hash: hash,
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue