Skip to content

Commit

Permalink
orders on promo text files
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jul 23, 2014
1 parent e6d733a commit 2fb6428
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resources/js/promo_text_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cstore.controller('promoTextFilesCtrl', function ($scope, $appService, $routePar
$scope.loadingPromoTextFileData = true;
var query = {"table": "promo_text_files__cstore"};
query.columns = ["programid", "siteid", "text_files", {"expression": "date", "format": "MM/DD/YYYY"}];
query.orders = {"__createdon": "desc"};
query.filter = {};
if ($scope.currentUser["data"]) {
if ($scope.currentUser["data"]["roleid"] == PROGRAMADMIN) {
Expand All @@ -50,10 +49,13 @@ cstore.controller('promoTextFilesCtrl', function ($scope, $appService, $routePar
query.filter["programid._id"] = $scope.filterdata.selectedProgram._id;
}
query.orders = {};
query.orders["programid.name"] = "asc";

if ($scope.sortingCol && $scope.sortingType) {
query.orders[$scope.sortingCol] = $scope.sortingType;
}
else {
query.orders = {"__createdon": "desc"};
}
query.max_rows = limit;
query.cursor = $scope.show.currentCursor;
query.$count = 1;
Expand Down

0 comments on commit 2fb6428

Please sign in to comment.