Limit API results to finite values only
Previously, the API call would attempt to limit results even if the limit was set to Infinity. This commit ensures that the 'per_page' parameter is only appended if the limit is a finite number.
This commit is contained in:
@@ -33,7 +33,7 @@ class WordpressClient implements CmsClient {
|
|||||||
_embed: 'true',
|
_embed: 'true',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options?.limit) {
|
if (options?.limit && options.limit !== Infinity) {
|
||||||
queryParams.append('per_page', options.limit.toString());
|
queryParams.append('per_page', options.limit.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user