ensure that users can filter their notifications by:

- failing attribute type (Critical vs All)
 - failure reason (Smart, Scrutiny, Both)

 fixes #300
This commit is contained in:
Jason Kulatunga
2022-06-20 08:15:06 -07:00
parent 46f3b1c02c
commit 7babc280a0
7 changed files with 311 additions and 34 deletions
@@ -15,17 +15,16 @@ func SendTestNotification(c *gin.Context) {
appConfig := c.MustGet("CONFIG").(config.Interface)
logger := c.MustGet("LOGGER").(logrus.FieldLogger)
testNotify := notify.Notify{
Logger: logger,
Config: appConfig,
Payload: notify.Payload{
FailureType: "EmailTest",
DeviceSerial: "FAKEWDDJ324KSO",
testNotify := notify.New(
logger,
appConfig,
models.Device{
SerialNumber: "FAKEWDDJ324KSO",
DeviceType: pkg.DeviceProtocolAta,
DeviceName: "/dev/sda",
Test: true,
},
}
true,
)
err := testNotify.Send()
if err != nil {
logger.Errorln("An error occurred while sending test notification", err)