From fd4b54897f261b2b4b2ac52aed7f0613424fc356 Mon Sep 17 00:00:00 2001 From: Vitaly Kravtsov Date: Wed, 6 Nov 2024 21:24:10 +0600 Subject: [PATCH] fix(typescript): proper promise wrapper behavior in list method --- resources/sdk/typescript/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/sdk/typescript/index.ts b/resources/sdk/typescript/index.ts index 76a9575..c52f217 100644 --- a/resources/sdk/typescript/index.ts +++ b/resources/sdk/typescript/index.ts @@ -949,7 +949,7 @@ export class GetResources< | ((value: BaseResponseResources) => PromiseLike | TResult1) | undefined | null, - _onrejected?: + onrejected?: | ((reason: unknown) => PromiseLike | TResult2) | undefined | null, @@ -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>().then((data) => onfulfilled(data)) : (response.json() as TResult1); - }); + }, onrejected); } }