This commit is contained in:
Michele Artini 2022-10-11 14:37:02 +02:00
parent 96ec14722c
commit 4573b41b30
1 changed files with 13 additions and 2 deletions

View File

@ -119,7 +119,12 @@ orgsModule.directive('resolveConflictsModal', function($http, $route, $window) {
call_http_post($http, 'api/organizations/conflicts/fix/similar', ids, function(res) {
$('#' + scope.modalId).modal('hide');
if (scope.openNewOrg == '1') {
$('#' + scope.modalId).on('hidden.bs.modal', function (e) { $window.location.assign('#!/edit/0/' + res.data[0]); });
$('#' + scope.modalId).on('hidden.bs.modal', function (e) {
var oldLoc = $window.location;
$window.location.assign('#!/edit/0/' + res.data[0]);
var newLoc = $window.location;
if (oldLoc == newLoc) $route.reload();
});
} else {
$('#' + scope.modalId).on('hidden.bs.modal', function (e) { $route.reload(); });
}
@ -323,7 +328,13 @@ orgsModule.directive('orgConflicts', function($http, $window, $location, $route,
angular.forEach(scope.conflicts, function(o, pos) { ids.push(o.id); });
if (merge) {
call_http_post($http, "api/organizations/conflicts/fix/similar", ids, function(res) { $window.location.assign('#!/edit/0/' + res.data[0]); });
call_http_post($http, "api/organizations/conflicts/fix/similar", ids, function(res) {
if (res.data[0] == scope.org.id) {
$route.reload();
} else {
$window.location.assign('#!/edit/0/' + res.data[0]);
}
});
} else {
call_http_post($http, "api/organizations/conflicts/fix/different", ids, function(res) { $route.reload(); });
}