1
0
mirror of https://github.com/actix/examples synced 2025-01-22 14:05:55 +01:00

Add comment

This commit is contained in:
Douman 2018-09-05 12:46:55 +03:00 committed by GitHub
parent 60c3ca2050
commit 5e2ef3723e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,8 @@ pub fn index(req: HttpRequest<AppState>) -> FutureResponse<HttpResponse> {
let mut context = Context::new();
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)? {
context.add("msg", &(flash.kind, flash.message));
session::clear_flash(&req);