diff --git a/frontend/app/scripts/controllers/RootCtrl.js b/frontend/app/scripts/controllers/RootCtrl.js index f7a82c3edc..b04cd62279 100644 --- a/frontend/app/scripts/controllers/RootCtrl.js +++ b/frontend/app/scripts/controllers/RootCtrl.js @@ -261,20 +261,17 @@ angular.module('theHiveControllers').controller('RootCtrl', return; } - CaseSrv.query({ - query: { - caseId: caseId - }, - range: '0-1' - }, function (response) { - if (response.length === 1) { - $state.go('app.case.details', { caseId: response[0].id }, { reload: true }); - } else { - NotificationSrv.log('Unable to find the case with number ' + caseId, 'error'); - } - }, function (err) { - NotificationSrv.error('Case search', err.data, err.status); - }); + CaseSrv.getById(caseId.toString()) + .then(function (response) { + if (response !== undefined) { + $state.go('app.case.details', { caseId: response._id }); + } else { + NotificationSrv.log('Unable to find the case with number ' + caseId, 'error'); + } + }) + .catch(function (err) { + NotificationSrv.error('Case search', err.data, err.status); + }) }; // Used to show spinning refresh icon n times