mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-07 07:42:45 +01:00
@@ -14,6 +14,7 @@ func playbookResponseID(playbook *model.PlaybookTemplateResponse) []driver.Docum
|
||||
if playbook == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return playbookID(playbook.ID)
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ func (s *Service) ListPlaybooks(ctx context.Context) ([]*model.PlaybookTemplateR
|
||||
|
||||
func (s *Service) CreatePlaybook(ctx context.Context, form *model.PlaybookTemplateForm) (doc *model.PlaybookTemplateResponse, err error) {
|
||||
defer s.publishRequest(ctx, err, "CreatePlaybook", playbookResponseID(doc))
|
||||
|
||||
return s.database.PlaybookCreate(ctx, form)
|
||||
}
|
||||
|
||||
@@ -36,10 +38,12 @@ func (s *Service) GetPlaybook(ctx context.Context, id string) (*model.PlaybookTe
|
||||
|
||||
func (s *Service) UpdatePlaybook(ctx context.Context, id string, form *model.PlaybookTemplateForm) (doc *model.PlaybookTemplateResponse, err error) {
|
||||
defer s.publishRequest(ctx, err, "UpdatePlaybook", playbookResponseID(doc))
|
||||
|
||||
return s.database.PlaybookUpdate(ctx, id, form)
|
||||
}
|
||||
|
||||
func (s *Service) DeletePlaybook(ctx context.Context, id string) (err error) {
|
||||
defer s.publishRequest(ctx, err, "DeletePlaybook", playbookID(id))
|
||||
|
||||
return s.database.PlaybookDelete(ctx, id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user