fixing copy/move routes, as well as the search on those routes

This commit is contained in:
jaredevantabor
2017-01-12 16:22:25 -08:00
parent 3be2da061a
commit 2f440a037b
3 changed files with 4 additions and 6 deletions

View File

@@ -60,9 +60,6 @@
}; };
function init(){ function init(){
var url = GetBasePath('inventory') + $stateParams.inventory_id + '/groups/';
url += $stateParams.group ? '?not__id__in=' + group.id + ',' + _.last($stateParams.group) : '?not__id=' + group.id;
list.basePath = url;
$scope.atRootLevel = $stateParams.group ? false : true; $scope.atRootLevel = $stateParams.group ? false : true;
// search init // search init

View File

@@ -30,8 +30,8 @@ var copyMoveGroupRoute = {
resolve: { resolve: {
Dataset: ['CopyMoveGroupList', 'QuerySet', '$stateParams', 'GetBasePath', 'group', Dataset: ['CopyMoveGroupList', 'QuerySet', '$stateParams', 'GetBasePath', 'group',
function(list, qs, $stateParams, GetBasePath, group) { function(list, qs, $stateParams, GetBasePath, group) {
$stateParams.copy_search.not__id__in = ($stateParams.group.length > 0 ? group.id + ',' + _.last($stateParams.group) : group.id); $stateParams.copy_search.not__id__in = ($stateParams.group && $stateParams.group.length > 0 ? group.id + ',' + _.last($stateParams.group) : group.id.toString());
let path = GetBasePath(list.name); let path = GetBasePath('inventory') + $stateParams.inventory_id + '/groups/';
return qs.search(path, $stateParams.copy_search); return qs.search(path, $stateParams.copy_search);
} }
], ],

View File

@@ -22,5 +22,6 @@ export default
key: true, key: true,
label: 'Target Group Name' label: 'Target Group Name'
} }
} },
basePath: 'api/v1/inventories/{{$stateParams.inventory_id}}/groups'
}); });