From 868671475c6c252260c528d930f099cbd65dde5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 8 Oct 2015 16:23:11 +0200 Subject: [PATCH] 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 0c768829e7cd63d5b9cbb85bd837dc2f20566c54. 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. --- frontend/app/helpers/path-helper.js | 6 ++++++ frontend/app/services/work-package-service.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/app/helpers/path-helper.js b/frontend/app/helpers/path-helper.js index b15b251c60..ef77bd597b 100644 --- a/frontend/app/helpers/path-helper.js +++ b/frontend/app/helpers/path-helper.js @@ -233,12 +233,18 @@ module.exports = function() { apiV3WorkPackagePath: function(workPackageId) { return PathHelper.apiV3 + '/work_packages/' + workPackageId; }, + apiV3WorkPackageFormPath: function(projectIdentifier) { + return PathHelper.apiv3ProjectWorkPackagesPath(projectIdentifier) + '/form'; + }, apiPrioritiesPath: function() { return PathHelper.apiV3 + '/priorities'; }, apiV3ProjectsPath: function(projectIdentifier) { return PathHelper.apiV3 + PathHelper.projectsPath() + '/' + projectIdentifier; }, + apiv3ProjectWorkPackagesPath: function(projectIdentifier) { + return PathHelper.apiV3ProjectsPath(projectIdentifier) + '/work_packages'; + }, apiV3ProjectCategoriesPath: function(projectIdentifier) { return PathHelper.apiV3ProjectsPath(projectIdentifier) + '/categories'; }, diff --git a/frontend/app/services/work-package-service.js b/frontend/app/services/work-package-service.js index b06d83f8bb..1bc88b8592 100644 --- a/frontend/app/services/work-package-service.js +++ b/frontend/app/services/work-package-service.js @@ -88,9 +88,9 @@ module.exports = function($http, links: { update: HALAPIResource .setup(PathHelper - .projectWorkPackagesFormPath(projectIdentifier)), + .apiV3WorkPackageFormPath(projectIdentifier)), updateImmediately: HALAPIResource.setup( - PathHelper.projectWorkPackagesPath(projectIdentifier), + PathHelper.apiv3ProjectWorkPackagesPath(projectIdentifier), { method: 'post' } ) }