mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 14:36:00 -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:
@@ -235,11 +235,15 @@ function SmartSearchController (
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.clearAllTerms = () => {
|
$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) {
|
if (!$scope.querySet) {
|
||||||
$state.go('.', { [searchKey]: queryset });
|
$state.go('.', { [searchKey]: queryset });
|
||||||
|
|||||||
Reference in New Issue
Block a user