Refresh title drop down when queries are modified, added or removed

pull/1454/head
Till Breuer 11 years ago
parent bcfeb703ad
commit 508c7ac662
  1. 2
      app/assets/javascripts/angular/controllers/dialogs/share.js
  2. 6
      app/assets/javascripts/angular/services/query-service.js

@ -51,8 +51,6 @@ angular.module('openproject.workPackages.controllers')
.then(function(data){
shareModal.deactivate();
$scope.$emit('flashMessage', data.status);
QueryService.fetchAvailableGroupedQueries($scope.query.project_id);
});
};
}]);

@ -305,6 +305,8 @@ angular.module('openproject.services')
saveQuery: function() {
var url = PathHelper.apiProjectQueryPath(query.project_id, query.id);
return QueryService.doQuery(url, query.toUpdateParams(), 'PUT', function(response){
QueryService.fetchAvailableGroupedQueries(query.project_id);
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_update') }} );
});
},
@ -314,6 +316,8 @@ angular.module('openproject.services')
var url = PathHelper.apiProjectQueriesPath(query.project_id);
return QueryService.doQuery(url, query.toParams(), 'POST', function(response){
query.save(response.data.query);
QueryService.fetchAvailableGroupedQueries(query.project_id);
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_create') }} );
});
},
@ -321,7 +325,9 @@ angular.module('openproject.services')
deleteQuery: function() {
var url = PathHelper.apiProjectQueryPath(query.project_id, query.id);
return QueryService.doQuery(url, query.toUpdateParams(), 'DELETE', function(response){
QueryService.fetchAvailableGroupedQueries(query.project_id);
QueryService.resetQuery();
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_delete') }} );
});
},

Loading…
Cancel
Save