Skip to content

Commit

Permalink
fix(acme_user_selector): handle acme users list pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed May 3, 2024
1 parent dd56fec commit d3e9d92
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions app/src/views/certificate/ACMEUserSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ watch(current, () => {
})
onMounted(async () => {
await acme_user.get_list().then(r => {
users.value = r.data
}).then(() => {
init()
})
users.value = []
let page = 1
while (true) {
const r = await acme_user.get_list({ page })
users.value.push(...r.data)
if (r?.data?.length < r?.pagination?.per_page)
break
page++
}
init()
// prevent the acme_user_id from being overwritten
mounted.value = true
Expand Down

0 comments on commit d3e9d92

Please sign in to comment.