mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
added database integration guide section
This commit is contained in:
@ -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())
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user