mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-06 09:47:43 +02:00
Fix incorrect types in rest-client extractJson (#68)
Signed-off-by: Nikolay Marchuk <nikolay.marchuk@hardcoreeng.com>
This commit is contained in:
@@ -201,7 +201,7 @@ class RestClientImpl implements RestClient {
|
||||
if (!response.ok) {
|
||||
throw new Error(response.statusText)
|
||||
}
|
||||
return await extractJson<MessagesGroup[]>(response)
|
||||
return await extractJson<Message[]>(response)
|
||||
},
|
||||
{ retries }
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ function reviver (key: string, value: any): Date {
|
||||
return value
|
||||
}
|
||||
|
||||
export async function extractJson<T> (response: Response): Promise<any> {
|
||||
export async function extractJson<T> (response: Response): Promise<T> {
|
||||
const encoding = response.headers.get('content-encoding')
|
||||
if (encoding === 'snappy') {
|
||||
const buffer = await response.arrayBuffer()
|
||||
|
||||
Reference in New Issue
Block a user