@go-avro/avro-js 0.0.2-beta.131 → 0.0.2-beta.132

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.
@@ -10,12 +10,8 @@ AvroQueryClient.prototype.useGetJobs = function (onProgress) {
10
10
  return useQuery({
11
11
  queryKey: ['jobs', this.companyId, this.company?.num_jobs],
12
12
  queryFn: async () => {
13
- if (this.company?.num_jobs === 0) {
14
- onProgress?.(1);
15
- return [];
16
- }
17
13
  onProgress?.(0);
18
- const pageCount = amt ? Math.ceil((this.company?.num_jobs ?? 0) / amt) : 0;
14
+ const pageCount = amt ? Math.ceil((this.company?.num_jobs ?? 0) / amt) : 1;
19
15
  let completed = 0;
20
16
  const promises = Array.from({ length: pageCount }, (_, i) => this.fetchJobs({ offset: i * amt, amt }));
21
17
  const trackedPromises = promises.map((promise) => promise.then((result) => {
@@ -8,7 +8,7 @@ AvroQueryClient.prototype.useGetRoutes = function (body, total, onProgress) {
8
8
  return this.fetchRoutes({ ...body, offset: 0 });
9
9
  }
10
10
  onProgress?.(0);
11
- const pageCount = body.amt ? Math.ceil(total / body.amt) : 0;
11
+ const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
12
12
  let completed = 0;
13
13
  const promises = Array.from({ length: pageCount }, (_, i) => this.fetchRoutes({
14
14
  ...body,
@@ -22,7 +22,7 @@ AvroQueryClient.prototype.useGetSkills = function (body, total, onProgress) {
22
22
  return this.fetchSkills({ ...body, offset: 0 });
23
23
  }
24
24
  onProgress?.(0);
25
- const pageCount = body.amt ? Math.ceil(total / body.amt) : 0;
25
+ const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
26
26
  let completed = 0;
27
27
  const promises = Array.from({ length: pageCount }, (_, i) => this.fetchSkills({
28
28
  ...body,
@@ -8,7 +8,7 @@ AvroQueryClient.prototype.useGetTeams = function (body, total, onProgress) {
8
8
  return this.fetchTeams({ ...body, offset: 0 });
9
9
  }
10
10
  onProgress?.(0);
11
- const pageCount = body.amt ? Math.ceil(total / body.amt) : 0;
11
+ const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
12
12
  let completed = 0;
13
13
  const promises = Array.from({ length: pageCount }, (_, i) => this.fetchTeams({
14
14
  ...body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.131",
3
+ "version": "0.0.2-beta.132",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",