Commit 3f92ca0a authored by Evren Kutar's avatar Evren Kutar

when 401 not load error modal

parent 803adf33
...@@ -84,7 +84,6 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -84,7 +84,6 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>' + '</div>' +
'</div>').modal(); '</div>').modal();
}; };
errorModal();
if (rejection.status === 400) { if (rejection.status === 400) {
$location.reload(); $location.reload();
...@@ -103,16 +102,19 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -103,16 +102,19 @@ app.config(['$httpProvider', function ($httpProvider) {
$location.path("/dashboard"); $location.path("/dashboard");
} }
} }
errorModal();
} }
$rootScope.$broadcast('show_notifications', rejection.data); $rootScope.$broadcast('show_notifications', rejection.data);
if (rejection.status === 404) { if (rejection.status === 404) {
console.log(404); console.log(404);
errorModal();
$location.path("/error/404"); $location.path("/error/404");
} }
// server 500 error returns with -1 on status. // server 500 error returns with -1 on status.
//if (rejection.status === -1 && rejection.config.data.model) { //if (rejection.status === -1 && rejection.config.data.model) {
if (rejection.status === 500) { if (rejection.status === 500) {
errorModal();
$location.path("/error/500"); $location.path("/error/500");
} }
return $q.reject(rejection); return $q.reject(rejection);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment