mirror of
https://github.com/actix/examples
synced 2025-01-22 22:05:57 +01:00
Add comment
This commit is contained in:
parent
60c3ca2050
commit
5e2ef3723e
@ -25,6 +25,8 @@ pub fn index(req: HttpRequest<AppState>) -> FutureResponse<HttpResponse> {
|
|||||||
let mut context = Context::new();
|
let mut context = Context::new();
|
||||||
context.add("tasks", &tasks);
|
context.add("tasks", &tasks);
|
||||||
|
|
||||||
|
//Session is set during operations on other endpoints
|
||||||
|
//that can redirect to index
|
||||||
if let Some(flash) = session::get_flash(&req)? {
|
if let Some(flash) = session::get_flash(&req)? {
|
||||||
context.add("msg", &(flash.kind, flash.message));
|
context.add("msg", &(flash.kind, flash.message));
|
||||||
session::clear_flash(&req);
|
session::clear_flash(&req);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user