mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
27 lines
488 B
TypeScript
27 lines
488 B
TypeScript
|
|
import { AlertState, CreateAlertAction } from './types';
|
||
|
|
|
||
|
|
export const alertCreationReducer = (
|
||
|
|
state: AlertState,
|
||
|
|
action: CreateAlertAction,
|
||
|
|
): AlertState => {
|
||
|
|
switch (action.type) {
|
||
|
|
case 'SET_ALERT_NAME':
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
name: action.payload,
|
||
|
|
};
|
||
|
|
case 'SET_ALERT_DESCRIPTION':
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
description: action.payload,
|
||
|
|
};
|
||
|
|
case 'SET_ALERT_LABELS':
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
labels: action.payload,
|
||
|
|
};
|
||
|
|
default:
|
||
|
|
return state;
|
||
|
|
}
|
||
|
|
};
|