Skip to content

Commit

Permalink
feat: playbook getter
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 24, 2024
1 parent 67190c9 commit 8942074
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions query/getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,19 @@ func FindTeam(ctx context.Context, identifier string, opts ...GetterOption) (*mo

return team, nil
}

func FindPlaybook(ctx context.Context, identifier string, opts ...GetterOption) (*models.Playbook, error) {
var field string
if _, err := uuid.Parse(identifier); err == nil {
field = "id"
} else {
field = "name"
}

team, err := findEntityByField[models.Playbook](ctx, field, identifier, opts...)
if err != nil {
return nil, err
}

return team, nil
}

0 comments on commit 8942074

Please sign in to comment.