Skip to content

Commit

Permalink
remove alert_suppression field upon fields removal
Browse files Browse the repository at this point in the history
  • Loading branch information
maximpn committed Nov 1, 2024
1 parent 7cf4857 commit c3b6fa7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ function deserializer(defaultValue: FormData): AlertSuppressionFormData {
};
}

function serializer(formData: FormData): { alert_suppression: AlertSuppression } {
function serializer(formData: FormData): { alert_suppression?: AlertSuppression } {
const alertSuppressionFormData = formData as AlertSuppressionFormData;

if (alertSuppressionFormData[SUPPRESSION_FIELDS].length === 0) {
return {};
}

return {
alert_suppression: {
group_by: alertSuppressionFormData[SUPPRESSION_FIELDS],
Expand Down

0 comments on commit c3b6fa7

Please sign in to comment.