Skip to content

Commit

Permalink
fix(api-axios): use request.length if response.limit not present on all
Browse files Browse the repository at this point in the history
  • Loading branch information
Christie Baker authored and Christie Baker committed Dec 13, 2024
1 parent 0994453 commit bd7812d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/api-axios/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ export default class AvApi {
const response = await this.query(config);

const key = this.getQueryResultKey(response.data);
const limit = response.data.limit || config?.limit;
const length = response.data?.length;
const limit = response.data.limit || length < response.data.totalCount ? length : config?.limit;
const totalPages = Math.ceil(response.data.totalCount / limit);
const result = response.data[key] || [];

Expand Down

0 comments on commit bd7812d

Please sign in to comment.