mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: some type fixes (#69860)
* some type fixes * restore empty object * undo 1 fix for now * commit betterer update * explicitly type slug and uid as string | undefined
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePluginMeta, DataSourceSettings, locationUtil } from '@grafana/data';
|
||||
import { DataSourcePluginMeta, DataSourceSettings, locationUtil, TestDataSourceResponse } from '@grafana/data';
|
||||
import {
|
||||
config,
|
||||
DataSourceWithBackend,
|
||||
@@ -79,14 +79,8 @@ const parseHealthCheckError = (errorResponse: any): parseDataSourceSaveResponse
|
||||
return { message, details };
|
||||
};
|
||||
|
||||
const parseHealthCheckSuccess = (response: any): parseDataSourceSaveResponse => {
|
||||
let message: string | undefined;
|
||||
let status: string;
|
||||
let details: { message?: string; verboseMessage?: string };
|
||||
|
||||
status = response.status;
|
||||
message = response.message;
|
||||
details = response.details;
|
||||
const parseHealthCheckSuccess = (response: TestDataSourceResponse): parseDataSourceSaveResponse => {
|
||||
const { details, message, status } = response;
|
||||
|
||||
return { status, message, details };
|
||||
};
|
||||
@@ -282,7 +276,7 @@ export function updateDataSource(dataSource: DataSourceSettings) {
|
||||
) => {
|
||||
try {
|
||||
await api.updateDataSource(dataSource);
|
||||
} catch (err: any) {
|
||||
} catch (err) {
|
||||
const formattedError = parseHealthCheckError(err);
|
||||
|
||||
dispatch(testDataSourceFailed(formattedError));
|
||||
|
||||
Reference in New Issue
Block a user