mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-15 23:10:59 +00:00
fix: frontend lint
This commit is contained in:
@@ -98,12 +98,9 @@ export function ExportDropdown({ filterState }: ExportDropdownProps) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use backendClient's instance to get the auth token
|
// Use backendClient's downloadFile method for blob response
|
||||||
const response = await backendClient.instance.get(
|
const response = await backendClient.downloadFile(
|
||||||
`/api/v1/monitoring/export?${params.toString()}`,
|
`/api/v1/monitoring/export?${params.toString()}`,
|
||||||
{
|
|
||||||
responseType: 'blob',
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get filename from content-disposition header
|
// Get filename from content-disposition header
|
||||||
|
|||||||
@@ -206,4 +206,19 @@ export abstract class BaseHttpClient {
|
|||||||
...config,
|
...config,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async downloadFile(
|
||||||
|
url: string,
|
||||||
|
config?: RequestConfig,
|
||||||
|
): Promise<AxiosResponse<Blob>> {
|
||||||
|
try {
|
||||||
|
const response = await this.instance.get<Blob>(url, {
|
||||||
|
responseType: 'blob',
|
||||||
|
...config,
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
return this.handleError(error as object);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "preserve",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user