Skip to content

Commit

Permalink
Merge pull request #314 from openinfradev/minor_fix
Browse files Browse the repository at this point in the history
trivial. add attribute metricParameters to system-notification-templates
  • Loading branch information
cho4036 authored Apr 1, 2024
2 parents f176ba0 + 6249029 commit db558bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion internal/delivery/http/system-notification-rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func (h *SystemNotificationRuleHandler) GetSystemNotificationRules(w http.Respon
if err := serializer.Map(r.Context(), condition, &out.SystemNotificationRules[i].SystemNotificationConditions[j]); err != nil {
log.Info(r.Context(), err)
}
log.Info(r.Context(), condition.Parameter)
err = json.Unmarshal(condition.Parameter, &out.SystemNotificationRules[i].SystemNotificationConditions[j].Parameters)
if err != nil {
log.Error(r.Context(), err)
Expand Down
7 changes: 7 additions & 0 deletions internal/delivery/http/system-notification-template.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ func (h *SystemNotificationTemplateHandler) GetOrganizationSystemNotificationTem
log.Info(r.Context(), err)
}
}

out.SystemNotificationTemplates[i].MetricParameters = make([]domain.SystemNotificationMetricParameterResponse, len(systemNotificationTemplate.MetricParameters))
for k, metricParameters := range systemNotificationTemplate.MetricParameters {
if err := serializer.Map(r.Context(), metricParameters, &out.SystemNotificationTemplates[i].MetricParameters[k]); err != nil {
log.Info(r.Context(), err)
}
}
}

if out.Pagination, err = pg.Response(r.Context()); err != nil {
Expand Down

0 comments on commit db558bd

Please sign in to comment.