Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Prev Previous commit
Next Next commit
fix: callback error
  • Loading branch information
hkmoon committed Jan 16, 2024
commit 01d4dac1c7a6c47f5df7f2c8ba765f8a0009c2e5
6 changes: 3 additions & 3 deletions src/models/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ class base {
let collect = [];

this.get(path, 1, perPage).then(response => {
let pages = response.headers.get('x-total-pages')

response.json().then(data => {
response.json().then(async data => {
data.forEach(item => collect.push(item));

let pages = await response.headers.get('x-total-pages')

if (pages === 1) return resolve(collect);

let tasks = base.createGetTasks(path, pages, 2, perPage);
Expand Down