Show image immediately after submitting review
This commit is contained in:
parent
eca2b6324b
commit
0ab5fee8b2
@ -217,9 +217,11 @@ async fn create_review(auth: AuthorizedUser, data: web::Data<AppData>, input: we
|
|||||||
place_description: input.place_description.clone(),
|
place_description: input.place_description.clone(),
|
||||||
title: input.title.clone(),
|
title: input.title.clone(),
|
||||||
content: input.content.clone(),
|
content: input.content.clone(),
|
||||||
rating: input.rating.clone(),
|
rating: input.rating.clone(),
|
||||||
image_id: input.image_id,
|
image_id: input.image_id,
|
||||||
image: None,
|
image: input.image_id.and_then(|image_id| {
|
||||||
|
db.query_row("SELECT * FROM images WHERE id = :id LIMIT 1", &[(":id", &image_id.to_string())], |row| Image::from_row(row)).ok()
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
Err(_) => HttpResponse::InternalServerError().finish(),
|
Err(_) => HttpResponse::InternalServerError().finish(),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user