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:
gbuomprisco
2024-08-11 12:31:48 +02:00
parent 3d7a7c6ce8
commit f054db212b

View File

@@ -33,7 +33,7 @@ class WordpressClient implements CmsClient {
_embed: 'true',
});
if (options?.limit) {
if (options?.limit && options.limit !== Infinity) {
queryParams.append('per_page', options.limit.toString());
}