mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DataSourceWithBackend: resources response (#23411)
This commit is contained in:
parent
938c61865d
commit
4a3399e953
@ -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 });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user