send webhook action

This commit is contained in:
Fred KISSIE
2026-08-12 18:48:14 +02:00
parent 21032bc22b
commit c6bd657ee6
5 changed files with 50 additions and 42 deletions
@@ -180,8 +180,9 @@ export default function AlertRuleGraphEditor({
const testAlert = async () => {
const isValid = await form.trigger();
const values = form.getValues();
if (!isValid) {
const values = form.getValues();
if (values.actions.length === 0) {
toast({
variant: "warning",
@@ -193,27 +194,14 @@ export default function AlertRuleGraphEditor({
return;
}
const values = form.getValues();
try {
const payload = formValuesToApiPayload(values);
if (isNew) {
const res = await api.post<
AxiosResponse<CreateAlertRuleResponse>
>(`/org/${orgId}/test-alert-rule`, payload);
toast({
title: t("alertingTestAlertSent"),
description: t("alertingTestAlertSentDescription")
});
} else {
await api.post(
`/org/${orgId}/alert-rule/${alertRuleId}`,
payload
);
toast({
title: t("alertingTestAlertSent"),
description: t("alertingTestAlertSentDescription")
});
}
await api.post(`/org/${orgId}/test-alert-rule`, payload);
toast({
title: t("alertingTestAlertSent"),
description: t("alertingTestAlertSentDescription")
});
} catch (e) {
toast({
title: t("error"),
+1 -1
View File
@@ -1371,7 +1371,7 @@ export const approvalQueries = {
},
refetchInterval: (query) => {
if (query.state.data) {
return durationToMs(30, "seconds");
return durationToMs(1.5, "minutes");
}
return false;
}