1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 01:51:23 +02:00

added database integration guide section

This commit is contained in:
Nikolay Kim
2017-12-18 19:38:16 -08:00
parent 2124730e0a
commit 56fd088163
3 changed files with 129 additions and 1 deletions

View File

@ -37,7 +37,7 @@ fn index(req: HttpRequest<State>) -> Box<Future<Item=HttpResponse, Error=Error>>
req.state().db.call_fut(CreateUser{name: name.to_owned()})
.and_then(|res| {
match res {
Ok(person) => ok(httpcodes::HTTPOk.build().json(person).unwrap()),
Ok(user) => ok(httpcodes::HTTPOk.build().json(user).unwrap()),
Err(_) => ok(httpcodes::HTTPInternalServerError.response())
}
})