Skip to content

Commit

Permalink
fix bug with uploaded file + sql request if map is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
lrollus committed Dec 9, 2021
1 parent 96b621d commit a64523e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,17 @@ class UploadedFileService extends ModelService {
"AND uf.content_type NOT similar to '%zip%' " +
"AND uf.deleted IS NULL " +
"AND " +
search +
(search==null || search.isEmpty() ? "true" : search) +
" GROUP BY uf.id, ai.id " +
sort

def data = []
def sql = new Sql(dataSource)
def mapParams = sqlSearchConditions.sqlParameters
println request
if (mapParams instanceof List && mapParams.isEmpty()) {
mapParams = [:] // if sqlSearchConditions.sqlParameters is empty, it return a list, otherwise a map (a bit tricky...).
}
mapParams.put("username", user.username)
sql.eachRow(request, mapParams) { resultSet ->
def row = SQLUtils.keysToCamelCase(resultSet.toRowResult())
Expand Down

0 comments on commit a64523e

Please sign in to comment.