Merge pull request #2894 from 0xF013/feature/19737-cannot-change-relations

19737 fix wrong relations call
pull/2902/head
Jan Sandbrink 10 years ago
commit 1e96a67851
  1. 13
      frontend/app/services/work-package-service.js
  2. 2
      frontend/app/work_packages/view_models/children-relations-handler.js
  3. 4
      frontend/app/work_packages/view_models/parent-relations-handler.js

@ -203,6 +203,19 @@ module.exports = function($http,
return AuthorisationService.can(modelName, action);
},
updateWithPayload: function(workPackage, payload) {
var options = { ajax: {
method: 'PATCH',
url: workPackage.links.updateImmediately.href,
headers: {
Accept: 'application/hal+json'
},
data: JSON.stringify(payload),
contentType: 'application/json; charset=utf-8'
}, force: true};
return workPackage.links.updateImmediately.fetch(options);
},
updateWorkPackage: function(workPackage, notify) {
var options = { ajax: {
method: 'PATCH',

@ -49,7 +49,7 @@ module.exports = function(PathHelper, CommonRelationsHandler, WorkPackageService
parentId: null
};
WorkPackageService.updateWorkPackage(scope.relation, params).then(function(response){
WorkPackageService.updateWithPayload(scope.relation, params).then(function(response){
handler.relations.splice(index, 1);
scope.workPackage.props.lockVersion = response.props.lockVersion;
scope.updateFocus(index);

@ -47,7 +47,7 @@ module.exports = function(CommonRelationsHandler, WorkPackageService, ApiHelper)
parentId: scope.relationToAddId
};
WorkPackageService.updateWorkPackage(this.workPackage, params).then(function() {
WorkPackageService.updateWithPayload(this.workPackage, params).then(function() {
scope.relationToAddId = '';
scope.updateFocus(-1);
scope.$emit('workPackageRefreshRequired');
@ -63,7 +63,7 @@ module.exports = function(CommonRelationsHandler, WorkPackageService, ApiHelper)
parentId: null
};
WorkPackageService.updateWorkPackage(scope.workPackage, params).then(function(response){
WorkPackageService.updateWithPayload(scope.workPackage, params).then(function(response){
handler.relations.splice(index, 1);
scope.workPackage.props.lockVersion = response.props.lockVersion;
scope.updateFocus(index);

Loading…
Cancel
Save