(cherry picked from commit ca7a62682e)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This commit is contained in:
co-authored by
Gilles De Mey
parent
33c6628c6a
commit
772ef1626f
@@ -58,6 +58,10 @@ const AmRoutes: FC = () => {
|
||||
|
||||
useCleanup((state) => state.unifiedAlerting.saveAMConfig);
|
||||
const handleSave = (data: Partial<FormAmRoute>) => {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newData = formAmRouteToAmRoute(
|
||||
alertManagerSourceName,
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function AlertmanagerConfig(): JSX.Element {
|
||||
const loading = isDeleting || isLoadingConfig || isSaving;
|
||||
|
||||
const onSubmit = (values: FormValues) => {
|
||||
if (alertManagerSourceName) {
|
||||
if (alertManagerSourceName && config) {
|
||||
dispatch(
|
||||
updateAlertManagerConfigAction({
|
||||
newConfig: JSON.parse(values.configJSON),
|
||||
|
||||
@@ -13,8 +13,13 @@ export interface AsyncRequestState<T> {
|
||||
requestId?: string;
|
||||
}
|
||||
|
||||
export const initialAsyncRequestState: AsyncRequestState<any> = Object.freeze({
|
||||
export const initialAsyncRequestState: Pick<
|
||||
AsyncRequestState<undefined>,
|
||||
'loading' | 'dispatched' | 'result' | 'error'
|
||||
> = Object.freeze({
|
||||
loading: false,
|
||||
result: undefined,
|
||||
error: undefined,
|
||||
dispatched: false,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user