Skip to content

Commit

Permalink
making awaiting a depagination now possible again
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxTale-Labs committed Dec 5, 2022
1 parent daa05e9 commit f2b67f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions src/application/ApplicationRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,8 @@ class ApplicationRequest {
if (cached) return cached;

if (page < 0) {
const result = new Promise((resolve, reject) => {
this.depaginateRequest(url).then(async (result) => {
await setItem(url + ":depaginated", result);
resolve(result);
}).catch((err) => {
reject(err);
});
});
const result = await this.depaginateRequest(url);
await setItem(url + ":depaginated", result);
return result;
}

Expand Down
10 changes: 2 additions & 8 deletions src/client/ClientRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,8 @@ class ClientRequest {
if (cached) return cached;

if (page < 0) {
const result = new Promise((resolve, reject) => {
this.depaginateRequest(url).then(async (result) => {
await setItem(url + ":depaginated", result);
resolve(result);
}).catch((err) => {
reject(err);
});
});
const result = await this.depaginateRequest(url);
await setItem(url + ":depaginated", result);
return result;
}

Expand Down

0 comments on commit f2b67f1

Please sign in to comment.