mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
23 lines
629 B
TypeScript
23 lines
629 B
TypeScript
|
|
import updateAlertRule, {
|
||
|
|
UpdateAlertRuleResponse,
|
||
|
|
} from 'api/alerts/updateAlertRule';
|
||
|
|
import { useMutation, UseMutationResult } from 'react-query';
|
||
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||
|
|
import { PostableAlertRuleV2 } from 'types/api/alerts/alertTypesV2';
|
||
|
|
|
||
|
|
export function useUpdateAlertRule(
|
||
|
|
id: string,
|
||
|
|
): UseMutationResult<
|
||
|
|
SuccessResponse<UpdateAlertRuleResponse> | ErrorResponse,
|
||
|
|
Error,
|
||
|
|
PostableAlertRuleV2
|
||
|
|
> {
|
||
|
|
return useMutation<
|
||
|
|
SuccessResponse<UpdateAlertRuleResponse> | ErrorResponse,
|
||
|
|
Error,
|
||
|
|
PostableAlertRuleV2
|
||
|
|
>({
|
||
|
|
mutationFn: (alertData) => updateAlertRule(id, alertData),
|
||
|
|
});
|
||
|
|
}
|