Skip to content

Commit

Permalink
fix(typescript): proper promise wrapper behavior in list method
Browse files Browse the repository at this point in the history
  • Loading branch information
krvital committed Nov 6, 2024
1 parent 84ba87f commit fd4b548
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/sdk/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ export class GetResources<
| ((value: BaseResponseResources<T>) => PromiseLike<TResult1> | TResult1)
| undefined
| null,
_onrejected?:
onrejected?:
| ((reason: unknown) => PromiseLike<TResult2> | TResult2)
| undefined
| null,
Expand All @@ -958,11 +958,11 @@ export class GetResources<
.get(buildResourceUrl(this.resourceName), {
searchParams: this.searchParamsObject,
})
.then((response: any) => {
.then((response) => {
return onfulfilled
? onfulfilled(response.json())
? response.json<BaseResponseResources<T>>().then((data) => onfulfilled(data))
: (response.json() as TResult1);
});
}, onrejected);
}
}

Expand Down

0 comments on commit fd4b548

Please sign in to comment.