Skip to content

Commit d654204

Browse files
committed
Fix force request
1 parent 7934cbb commit d654204

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

dist/scripts/api-console.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,13 +1136,7 @@
11361136
var keys = Object.keys(form.form).filter(function (key) { return key.indexOf('$') === -1;});
11371137

11381138
keys.forEach(function (fieldName) {
1139-
var value = angular.copy(form.form[fieldName].$viewValue);
1140-
1141-
value = value || '';
1142-
1143-
console.log(value);
1144-
1145-
form.form[fieldName].$setViewValue(value);
1139+
form.form[fieldName].$setDirty();
11461140
});
11471141

11481142
return form.form.$valid;
@@ -1360,8 +1354,6 @@
13601354
jQuery($event.currentTarget).closest('form').find('.ng-invalid').first().focus();
13611355
}
13621356

1363-
// console.log($scope.form.$valid);
1364-
13651357
if($scope.context.forceRequest || validateForm($scope.form)) {
13661358
var url;
13671359
var context = $scope.context;

src/app/directives/sidebar.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,7 @@
157157
var keys = Object.keys(form.form).filter(function (key) { return key.indexOf('$') === -1;});
158158

159159
keys.forEach(function (fieldName) {
160-
var value = angular.copy(form.form[fieldName].$viewValue);
161-
162-
value = value || '';
163-
164-
console.log(value);
165-
166-
form.form[fieldName].$setViewValue(value);
160+
form.form[fieldName].$setDirty();
167161
});
168162

169163
return form.form.$valid;
@@ -381,8 +375,6 @@
381375
jQuery($event.currentTarget).closest('form').find('.ng-invalid').first().focus();
382376
}
383377

384-
// console.log($scope.form.$valid);
385-
386378
if($scope.context.forceRequest || validateForm($scope.form)) {
387379
var url;
388380
var context = $scope.context;

0 commit comments

Comments
 (0)