Fix issue #920: create project values on empty projects

stable
Jesús Espino 2014-09-10 16:10:01 +02:00
parent 87e8afa100
commit 6a999cc811
1 changed files with 3 additions and 1 deletions

View File

@ -180,7 +180,9 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
return if not form.validate()
$scope.newValue.project = $scope.project.id
$scope.newValue.order = $scope.maxValueOrder + 1
$scope.newValue.order = if $scope.maxValueOrder then $scope.maxValueOrder + 1 else 1
promise = $repo.create(valueType, $scope.newValue)
promise.then =>
$ctrl.loadValues().then ->