settings: Save duration in challenge.json
This commit is contained in:
parent
58217d1d8a
commit
123467f3eb
3 changed files with 9 additions and 2 deletions
|
|
@ -518,7 +518,11 @@ angular.module("FICApp")
|
|||
$rootScope.settings.activateTime = new Date(response.activateTime);
|
||||
})
|
||||
$scope.challenge = SettingsChallenge.get();
|
||||
$scope.duration = 360;
|
||||
$scope.duration = 360;
|
||||
$scope.challenge.$promise.then(function(c) {
|
||||
if (c.duration)
|
||||
$scope.duration = c.duration;
|
||||
});
|
||||
|
||||
$scope.exerciceDependChange = function() {
|
||||
if ($scope.config.enableExerciceDepend)
|
||||
|
|
@ -528,6 +532,7 @@ angular.module("FICApp")
|
|||
};
|
||||
|
||||
$scope.saveChallengeInfo = function() {
|
||||
this.challenge.duration = $scope.duration;
|
||||
this.challenge.$update(function(response) {
|
||||
$scope.addToast('success', 'Infos du challenge mises à jour avec succès !');
|
||||
}, function(response) {
|
||||
|
|
|
|||
Reference in a new issue