diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index 35ea64c62ec..f4071c8fc32 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -1492,17 +1492,17 @@ export default { }) }, fetchTemplates (templateFilter, params) { - params = params || {} - if (params.keyword || params.category !== templateFilter) { - params.page = 1 - params.pageSize = params.pageSize || 10 + const args = Object.assign({}, params) + if (args.keyword || args.category !== templateFilter) { + args.page = 1 + args.pageSize = args.pageSize || 10 } - params.zoneid = _.get(this.zone, 'id') - params.templatefilter = templateFilter - params.details = 'min' + args.zoneid = _.get(this.zone, 'id') + args.templatefilter = templateFilter + args.details = 'min' return new Promise((resolve, reject) => { - api('listTemplates', params).then((response) => { + api('listTemplates', args).then((response) => { resolve(response) }).catch((reason) => { // ToDo: Handle errors diff --git a/ui/src/views/compute/wizard/TemplateIsoSelection.vue b/ui/src/views/compute/wizard/TemplateIsoSelection.vue index 31d625971a6..b9de394db54 100644 --- a/ui/src/views/compute/wizard/TemplateIsoSelection.vue +++ b/ui/src/views/compute/wizard/TemplateIsoSelection.vue @@ -104,7 +104,6 @@ export default { const key = this.inputDecorator.slice(0, -2) for (const filter of this.filterOpts) { if (items[filter.id] && items[filter.id][key] && items[filter.id][key].length > 0) { - this.filterType = filter.id this.checkedValue = items[filter.id][key][0].id break } @@ -113,6 +112,7 @@ export default { inputDecorator (newValue, oldValue) { if (newValue !== oldValue) { this.filter = '' + this.filterType = 'featured' } } },