fixes pagination of template/isos does not match on deploy VM

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
utchoang 2020-08-26 14:25:51 +07:00 committed by Rohit Yadav
parent 86daf79a77
commit d4ebf4c7be
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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'
}
}
},