@blazeo.com/calendar-client 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -789,16 +789,16 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
|
|
|
789
789
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
790
790
|
}
|
|
791
791
|
const pageSize = opts.page_size ?? opts.pageSize;
|
|
792
|
+
const take = opts.take;
|
|
792
793
|
const pageNum = opts.page != null ? Number(opts.page) : null;
|
|
793
|
-
|
|
794
|
-
const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
|
|
795
|
-
if (usePageMode) {
|
|
794
|
+
if (pageNum != null && pageNum >= 1) {
|
|
796
795
|
query.page = pageNum;
|
|
797
|
-
|
|
796
|
+
const size = pageSize ?? take;
|
|
797
|
+
if (size != null) query.page_size = size;
|
|
798
798
|
} else {
|
|
799
799
|
if (opts.skip != null) query.skip = opts.skip;
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
800
|
+
const limit = take ?? pageSize;
|
|
801
|
+
if (limit != null) query.take = limit;
|
|
802
802
|
}
|
|
803
803
|
const res = await reqGet(path, query, { headers: { offset: String(offset) } });
|
|
804
804
|
if (res.status !== "success") {
|
package/dist/index.mjs
CHANGED
|
@@ -715,16 +715,16 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
|
|
|
715
715
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
716
716
|
}
|
|
717
717
|
const pageSize = opts.page_size ?? opts.pageSize;
|
|
718
|
+
const take = opts.take;
|
|
718
719
|
const pageNum = opts.page != null ? Number(opts.page) : null;
|
|
719
|
-
|
|
720
|
-
const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
|
|
721
|
-
if (usePageMode) {
|
|
720
|
+
if (pageNum != null && pageNum >= 1) {
|
|
722
721
|
query.page = pageNum;
|
|
723
|
-
|
|
722
|
+
const size = pageSize ?? take;
|
|
723
|
+
if (size != null) query.page_size = size;
|
|
724
724
|
} else {
|
|
725
725
|
if (opts.skip != null) query.skip = opts.skip;
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
726
|
+
const limit = take ?? pageSize;
|
|
727
|
+
if (limit != null) query.take = limit;
|
|
728
728
|
}
|
|
729
729
|
const res = await reqGet(path, query, { headers: { offset: String(offset) } });
|
|
730
730
|
if (res.status !== "success") {
|