Fix user management example
This commit is contained in:
parent
fb205cd397
commit
f0517ef0b7
|
@ -1,5 +1,6 @@
|
||||||
use anyhow::*;
|
use anyhow::*;
|
||||||
use futures::{future::BoxFuture, FutureExt};
|
use futures_core::future::BoxFuture;
|
||||||
|
use futures_util::FutureExt;
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use northstar::{
|
use northstar::{
|
||||||
GEMINI_MIME,
|
GEMINI_MIME,
|
||||||
|
@ -51,7 +52,7 @@ fn handle_request(request: Request) -> BoxFuture<'static, Result<Response>> {
|
||||||
if request.path_segments()[0].eq("push") { // User connecting to /push
|
if request.path_segments()[0].eq("push") { // User connecting to /push
|
||||||
if let Some(push) = request.input() {
|
if let Some(push) = request.input() {
|
||||||
user.as_mut().push_str(push);
|
user.as_mut().push_str(push);
|
||||||
user.save();
|
user.save()?;
|
||||||
} else {
|
} else {
|
||||||
return Ok(Response::input_lossy("Enter a string to push"));
|
return Ok(Response::input_lossy("Enter a string to push"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue