Skip to content

Commit cc865cd

Browse files
committed
Resolve explicit any
1 parent d50f0ac commit cc865cd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/DataSource.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { buildRequestBody } from './graphspecs';
33

44
describe('URL conversions', () => {
55
it('Params', () => {
6-
expect(buildUrlWithParams('hi', { A: 5, TE: 'TTI' })).toBe('hi?A=5&TE=TTI');
6+
expect(buildUrlWithParams('hi', { A: '5', TE: 'TTI' })).toBe('hi?A=5&TE=TTI');
77
});
88
it('Request body', () => {
99
expect(buildRequestBody({ spec: ['comb', { site: 'heute' }] })).toBe('request={"spec":["comb",{"site":"heute"}]}');

src/DataSource.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { getBackendSrv } from '@grafana/runtime';
1313
import { buildRequestBody, combinedDesc, graphDefinitionRequest } from './graphspecs';
1414
import { MyQuery, defaultQuery, MyDataSourceOptions } from './types';
1515

16-
export const buildUrlWithParams = (url: string, params: any) => url + '?' + new URLSearchParams(params).toString();
16+
export const buildUrlWithParams = (url: string, params: Record<string, string>) =>
17+
url + '?' + new URLSearchParams(params).toString();
1718

1819
function buildMetricDataFrame(response: any, query: MyQuery) {
1920
if (response.data.result_code !== 0) {

0 commit comments

Comments
 (0)