(ctx context.Context, alertID int)
| 982 | } |
| 983 | |
| 984 | func (c *Client) GetAlertByID(ctx context.Context, alertID int) (*ent.Alert, error) { |
| 985 | alert, err := c.Ent.Alert.Query().Where(alert.IDEQ(alertID)).WithDecisions().WithEvents().WithMetas().WithOwner().First(ctx) |
| 986 | if err != nil { |
| 987 | // record not found, 404 |
| 988 | if ent.IsNotFound(err) { |
| 989 | log.Warningf("GetAlertByID (not found): %s", err) |
| 990 | return nil, ItemNotFound |
| 991 | } |
| 992 | |
| 993 | c.Log.Warningf("GetAlertByID : %s", err) |
| 994 | |
| 995 | return nil, QueryFail |
| 996 | } |
| 997 | |
| 998 | return alert, nil |
| 999 | } |
no test coverage detected