Skip to content

Commit

Permalink
fix(api-axios): default 1 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 bd7812d commit 0f2ca5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api-axios/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default class AvApi {

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

Expand Down

0 comments on commit 0f2ca5d

Please sign in to comment.