Skip to content

Commit

Permalink
Use fragment combinators for filters in task summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Brown committed Oct 29, 2019
1 parent ea3bd30 commit 3e6fdf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Fixed

- Fixed bug listing task summaries [\#5238](https://github.com/raster-foundry/raster-foundry/pull/5238)

### Security

## [1.32.0](https://github.com/raster-foundry/raster-foundry/compare/1.31.0...1.32.0)
Expand Down
11 changes: 5 additions & 6 deletions app-backend/db/src/main/scala/TaskDao.scala
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,11 @@ object TaskDao extends Dao[Task] {
SELECT
status,
ST_Transform(ST_Buffer(ST_Union(ST_Buffer(geometry, 1)), -1), 4326) AS geometry
FROM tasks
WHERE
project_id = ${projectId}
AND project_layer_id = ${layerId}
""" ++ (taskStatusF(statusO.toList map { _.toString })
.getOrElse(Fragment.empty)) ++ fr"GROUP BY status")
FROM tasks""" ++ Fragments
.whereAndOpt(
Some(fr"project_layer_id = ${layerId}"),
Some(fr"project_id = ${projectId}"),
taskStatusF(statusO.toList map { _.toString })) ++ fr"GROUP BY status")
.query[UnionedGeomWithStatus]
.to[List]
.map(geomWithStatusList => {
Expand Down

0 comments on commit 3e6fdf1

Please sign in to comment.