Skip to content
Snippets Groups Projects
Commit fa296efd authored by syuilo's avatar syuilo
Browse files

refactor: fix type

parent d9d98f84
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment