mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Check defaults against query set to make sure credential_type does not get overwritten
- We want to preserve the existing `credential_type` param that already exists in `queryset` and not have `defaults ` overwrite it. We first loop through the `defaults` object keys and check it against the the keys of `queryset` and if the keys match, then set the value to `queryset[key]`.
This commit is contained in:
parent
85aeb799dc
commit
99ea28c3fd
@ -235,11 +235,15 @@ function SmartSearchController (
|
||||
};
|
||||
|
||||
$scope.clearAllTerms = () => {
|
||||
const cleared = _(defaults).omit(_.isNull).value();
|
||||
const cleared = {};
|
||||
|
||||
delete cleared.page;
|
||||
_.forOwn(defaults, function(value, key) {
|
||||
if (key !== "page") {
|
||||
cleared[key] = _.has(queryset, key) ? queryset[key] : value;
|
||||
}
|
||||
});
|
||||
|
||||
queryset = cleared;
|
||||
queryset = _(cleared).omit(_.isNull).value();
|
||||
|
||||
if (!$scope.querySet) {
|
||||
$state.go('.', { [searchKey]: queryset });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user