Merge pull request #1430 from umbraco/temp-U4-8849

Fixes: U4-8849 301 Url tracker - When deleting last item on a page th…
This commit is contained in:
Shannon Deminick
2016-08-12 16:40:49 +02:00
committed by GitHub

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");
});