diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-01 20:13:22 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-01 20:13:22 +0900 |
| commit | fa296efdf6ad38f19595c3e7fe1b951e4b9d7cbc (patch) | |
| tree | 37b4dc83304fe6817ee64c21d852a5efab3b9c34 /packages/backend/src/core/HttpRequestService.ts | |
| parent | refactor: fix type (diff) | |
| download | sharkey-fa296efdf6ad38f19595c3e7fe1b951e4b9d7cbc.tar.gz sharkey-fa296efdf6ad38f19595c3e7fe1b951e4b9d7cbc.tar.bz2 sharkey-fa296efdf6ad38f19595c3e7fe1b951e4b9d7cbc.zip | |
refactor: fix type
Diffstat (limited to 'packages/backend/src/core/HttpRequestService.ts')
| -rw-r--r-- | packages/backend/src/core/HttpRequestService.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index baf74acfa6..e32026b04f 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -95,7 +95,7 @@ export class HttpRequestService { } @bindThis - public async getJson(url: string, accept = 'application/json, */*', headers?: Record<string, string>): Promise<unknown> { + public async getJson<T = unknown>(url: string, accept = 'application/json, */*', headers?: Record<string, string>): Promise<T> { const res = await this.send(url, { method: 'GET', headers: Object.assign({ @@ -106,7 +106,7 @@ export class HttpRequestService { size: 1024 * 256, }); - return await res.json(); + return await res.json() as T; } @bindThis |