Use correct manual work package form path

The new controller builds its own API resource using the
static `/projects/:identifier/work_packages/form` path,
which was expanded with the `/api/v3` prefix until 0c768829e7.

With this commit, the resource was invalid and causes new work packages to be broken.
In order to restore the manual path, a new path helper was created.
pull/3622/head
Oliver Günther 9 years ago
parent 982439e52b
commit 868671475c
  1. 6
      frontend/app/helpers/path-helper.js
  2. 4
      frontend/app/services/work-package-service.js

@ -233,12 +233,18 @@ module.exports = function() {
apiV3WorkPackagePath: function(workPackageId) { apiV3WorkPackagePath: function(workPackageId) {
return PathHelper.apiV3 + '/work_packages/' + workPackageId; return PathHelper.apiV3 + '/work_packages/' + workPackageId;
}, },
apiV3WorkPackageFormPath: function(projectIdentifier) {
return PathHelper.apiv3ProjectWorkPackagesPath(projectIdentifier) + '/form';
},
apiPrioritiesPath: function() { apiPrioritiesPath: function() {
return PathHelper.apiV3 + '/priorities'; return PathHelper.apiV3 + '/priorities';
}, },
apiV3ProjectsPath: function(projectIdentifier) { apiV3ProjectsPath: function(projectIdentifier) {
return PathHelper.apiV3 + PathHelper.projectsPath() + '/' + projectIdentifier; return PathHelper.apiV3 + PathHelper.projectsPath() + '/' + projectIdentifier;
}, },
apiv3ProjectWorkPackagesPath: function(projectIdentifier) {
return PathHelper.apiV3ProjectsPath(projectIdentifier) + '/work_packages';
},
apiV3ProjectCategoriesPath: function(projectIdentifier) { apiV3ProjectCategoriesPath: function(projectIdentifier) {
return PathHelper.apiV3ProjectsPath(projectIdentifier) + '/categories'; return PathHelper.apiV3ProjectsPath(projectIdentifier) + '/categories';
}, },

@ -88,9 +88,9 @@ module.exports = function($http,
links: { links: {
update: HALAPIResource update: HALAPIResource
.setup(PathHelper .setup(PathHelper
.projectWorkPackagesFormPath(projectIdentifier)), .apiV3WorkPackageFormPath(projectIdentifier)),
updateImmediately: HALAPIResource.setup( updateImmediately: HALAPIResource.setup(
PathHelper.projectWorkPackagesPath(projectIdentifier), PathHelper.apiv3ProjectWorkPackagesPath(projectIdentifier),
{ method: 'post' } { method: 'post' }
) )
} }

Loading…
Cancel
Save