diff --git a/internal/usecase/system-notification-rule.go b/internal/usecase/system-notification-rule.go index d777e432..ad04ee57 100644 --- a/internal/usecase/system-notification-rule.go +++ b/internal/usecase/system-notification-rule.go @@ -191,6 +191,11 @@ func (u *SystemNotificationRuleUsecase) MakeDefaultSystemNotificationRules(ctx c return err } + err = u.organizationRepo.AddSystemNotificationTemplates(ctx, organizationId, templates) + if err != nil { + return httpErrors.NewBadRequestError(err, "ST_FAILED_ADD_ORGANIZATION_SYSTEM_NOTIFICATION_TEMPLATE", "") + } + rules := make([]model.SystemNotificationRule, 0) for _, template := range templates { if template.Name == domain.SN_TYPE_NODE_CPU_HIGH_LOAD { diff --git a/internal/usecase/system-notification-template.go b/internal/usecase/system-notification-template.go index f0c7743f..99240baf 100644 --- a/internal/usecase/system-notification-template.go +++ b/internal/usecase/system-notification-template.go @@ -188,7 +188,7 @@ func (u *SystemNotificationTemplateUsecase) UpdateOrganizations(ctx context.Cont func (u *SystemNotificationTemplateUsecase) AddOrganizationSystemNotificationTemplates(ctx context.Context, organizationId string, systemNotificationTemplateIds []string) error { _, err := u.organizationRepo.Get(ctx, organizationId) if err != nil { - return httpErrors.NewBadRequestError(err, "O_NOT_EXISTED_NAME", "") + return httpErrors.NewBadRequestError(err, "ST_NOT_EXISTED_NAME", "") } systemNotificationTemplates := make([]model.SystemNotificationTemplate, 0)