Fixes: U4-8849 301 Url tracker - When deleting last item on a page the url tracker should check for new results.

This commit is contained in:
Mads Rasmussen
2016-08-12 10:49:20 +02:00
parent de2d4bef13
commit 1c15daca52

View File

@@ -85,6 +85,18 @@
vm.redirectUrls.splice(index, 1);
notificationsService.success("Redirect Url Removed!", "Redirect Url has been deleted");
// check if new redirects needs to be loaded
if(vm.redirectUrls.length === 0 && vm.pagination.totalPages > 1) {
// if we are not on the first page - get records from the previous
if(vm.pagination.pageIndex > 0 ) {
vm.pagination.pageIndex = vm.pagination.pageIndex - 1;
vm.pagination.pageNumber = vm.pagination.pageNumber - 1;
}
search();
}
}, function(error) {
notificationsService.error("Redirect Url Error!", "Redirect Url was not deleted");
});