fix(tasks): do not crash when order by id and position
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kolaente 2024-06-13 16:35:47 +02:00
parent eb0f1a977b
commit d3f397b036
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -58,6 +58,10 @@ func getOrderByDBStatement(opts *taskSearchOptions) (orderby string, err error)
prefix = "task_positions."
}
if param.sortBy == taskPropertyID {
prefix = "tasks."
}
// Mysql sorts columns with null values before ones without null value.
// Because it does not have support for NULLS FIRST or NULLS LAST we work around this by
// first sorting for null (or not null) values and then the order we actually want to.