Skip to content

Commit f2b67f1

Browse files
committed
making awaiting a depagination now possible again
1 parent daa05e9 commit f2b67f1

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

src/application/ApplicationRequest.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,8 @@ class ApplicationRequest {
7171
if (cached) return cached;
7272

7373
if (page < 0) {
74-
const result = new Promise((resolve, reject) => {
75-
this.depaginateRequest(url).then(async (result) => {
76-
await setItem(url + ":depaginated", result);
77-
resolve(result);
78-
}).catch((err) => {
79-
reject(err);
80-
});
81-
});
74+
const result = await this.depaginateRequest(url);
75+
await setItem(url + ":depaginated", result);
8276
return result;
8377
}
8478

src/client/ClientRequest.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,8 @@ class ClientRequest {
7272
if (cached) return cached;
7373

7474
if (page < 0) {
75-
const result = new Promise((resolve, reject) => {
76-
this.depaginateRequest(url).then(async (result) => {
77-
await setItem(url + ":depaginated", result);
78-
resolve(result);
79-
}).catch((err) => {
80-
reject(err);
81-
});
82-
});
75+
const result = await this.depaginateRequest(url);
76+
await setItem(url + ":depaginated", result);
8377
return result;
8478
}
8579

0 commit comments

Comments
 (0)