Skip to content
Permalink
Browse files
PUT implementation
  • Loading branch information
marcusbuffett committed Oct 23, 2020
1 parent 1ede32c commit 0f562abd5a67cd6dd9c76d015e49cb81c6fca890
Showing 1 changed file with 4 additions and 1 deletion.
@@ -34,7 +34,10 @@ fn delete_user(db: State<Database>, username: String) -> EndpointResult<Json<Use

#[put("/users", data = "<user>")]
fn put_user(db: State<Database>, user: Json<User>) -> EndpointResult<Json<User>> {
todo!()
db.users
.insert(user.username.as_bytes(), user.clone())
.unwrap();
Ok(Json(user.0))
}

fn main() {

0 comments on commit 0f562ab

Please sign in to comment.