Skip to content

Commit

Permalink
fix: notification config change status case
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Feb 5, 2025
1 parent c6c5e85 commit 9926dea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/021_notification.sql
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ CREATE OR REPLACE FUNCTION insert_notification_history_config_change()
RETURNS TRIGGER AS $$
BEGIN
-- Only config item notifications need to be inserted
IF NEW.source_event LIKE 'config.%' AND ((TG_OP = 'INSERT') OR (TG_OP = 'UPDATE' AND OLD.status != NEW.status)) THEN
IF NEW.source_event LIKE 'config.%' AND ((TG_OP = 'INSERT') OR (TG_OP = 'UPDATE' AND OLD.status != NEW.status)) AND NEW.status != '' THEN
INSERT INTO config_changes (config_id, change_type, source, details, external_change_id)
VALUES (NEW.resource_id, CONCAT('Notification', NEW.status), 'notification', NEW.payload, CONCAT(NEW.id, '-', NOW()));
VALUES (NEW.resource_id, CONCAT('Notification', INITCAP(NEW.status)), 'notification', NEW.payload, CONCAT(NEW.id, '-', NOW()));
END IF;

RETURN NEW;
Expand Down

0 comments on commit 9926dea

Please sign in to comment.