DataSourceWithBackend: resources response (#23411)

This commit is contained in:
Ryan McKinley 2020-04-07 12:52:31 -07:00 committed by GitHub
parent 938c61865d
commit 4a3399e953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,14 +104,14 @@ export class DataSourceWithBackend<
/**
* Make a GET request to the datasource resource path
*/
async getResource(path: string, params?: any): Promise<Record<string, any>> {
async getResource(path: string, params?: any): Promise<any> {
return getBackendSrv().get(`/api/datasources/${this.id}/resources/${path}`, params);
}
/**
* Send a POST request to the datasource resource path
*/
async postResource(path: string, body?: any): Promise<Record<string, any>> {
async postResource(path: string, body?: any): Promise<any> {
return getBackendSrv().post(`/api/datasources/${this.id}/resources/${path}`, { ...body });
}