Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e558acc

Browse files
committedMay 26, 2016
Update CRUDService to quote "Sort" parameters for PG
1 parent 0a01190 commit e558acc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Backend/src/modules/crud/services/CRUDService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function _searchQuery(tableName, criteria, columns) {
194194
if (!_.find(columns, c => c.name === criteria.sortBy)) {
195195
throw new ValidationError(`There is no such column called '${criteria.sortBy}' for '${tableName}'`);
196196
}
197-
orderBy = `ORDER BY ${criteria.sortBy} `;
197+
orderBy = `ORDER BY ${_escapeName(criteria.sortBy)} `;
198198
if (criteria.sortOrder) {
199199
orderBy += criteria.sortOrder === 'Descending' ? 'DESC' : 'ASC';
200200
}

0 commit comments

Comments
 (0)
Please sign in to comment.