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