diff --git a/src/api/system.rs b/src/api/system.rs index 631255b..3a65015 100644 --- a/src/api/system.rs +++ b/src/api/system.rs @@ -15,7 +15,7 @@ pub fn get_users(_: Params, state: &RpcState) -> Result, A struct CreateUser { name: String, password: String, - comment: String, + comment: Option, } 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, }, )