Skip to content

Commit

Permalink
bugfix: same image gets show as other images in report
Browse files Browse the repository at this point in the history
  • Loading branch information
worldofjoni committed Jun 21, 2024
1 parent 1649146 commit e29fcc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/layer/data/database/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ impl CommandDataAccess for PersistentCommandData {
let other_image_urls = sqlx::query_scalar!(
"
SELECT image_id FROM image_detail
WHERE currently_visible AND food_id = $1
WHERE currently_visible AND food_id = $1 AND image_id <> $2
ORDER BY rank DESC
",
record.food_id
record.food_id,
image_id
)
.fetch_all(&self.pool)
.await?
Expand Down Expand Up @@ -219,7 +220,6 @@ mod test {
other_image_urls: vec![
image_id_to_url(Uuid::parse_str("ea8cce48-a3c7-4f8e-a222-5f3891c13804").unwrap()),
image_id_to_url(Uuid::parse_str("1aa73d5d-1701-4975-aa3c-1422a8bc10e8").unwrap()),
image_id_to_url(Uuid::parse_str("76b904fe-d0f1-4122-8832-d0e21acab86d").unwrap()),
],
}
}
Expand Down

0 comments on commit e29fcc8

Please sign in to comment.