|
|
|
@ -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') }} ); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|