MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / FindByID

Method FindByID

app/controlplane/pkg/data/orginvitation.go:119–131  ·  view source on GitHub ↗
(ctx context.Context, id uuid.UUID)

Source from the content-addressed store, hash-verified

117}
118
119func (r *OrgInvitation) FindByID(ctx context.Context, id uuid.UUID) (*biz.OrgInvitation, error) {
120 ctx, span := otelx.Start(ctx, orgInvitationRepoTracer, "OrgInvitation.FindByID")
121 defer span.End()
122
123 invite, err := r.query().Where(orginvitation.ID(id)).Only(ctx)
124 if err != nil && !ent.IsNotFound(err) {
125 return nil, fmt.Errorf("error finding invite %s: %w", id.String(), err)
126 } else if invite == nil {
127 return nil, nil
128 }
129
130 return entInviteToBiz(invite), nil
131}
132
133func (r *OrgInvitation) SoftDelete(ctx context.Context, id uuid.UUID) error {
134 ctx, span := otelx.Start(ctx, orgInvitationRepoTracer, "OrgInvitation.SoftDelete")

Callers 1

CreateMethod · 0.95

Calls 8

queryMethod · 0.95
StartFunction · 0.92
IDFunction · 0.92
IsNotFoundFunction · 0.92
entInviteToBizFunction · 0.85
StringMethod · 0.65
OnlyMethod · 0.45
WhereMethod · 0.45

Tested by

no test coverage detected