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

Function withOrganizationID

app/controlplane/pkg/data/ent/mutation.go:9089–9108  ·  view source on GitHub ↗

withOrganizationID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

9087
9088// withOrganizationID sets the ID field of the mutation.
9089func withOrganizationID(id uuid.UUID) organizationOption {
9090 return func(m *OrganizationMutation) {
9091 var (
9092 err error
9093 once sync.Once
9094 value *Organization
9095 )
9096 m.oldValue = func(ctx context.Context) (*Organization, error) {
9097 once.Do(func() {
9098 if m.done {
9099 err = errors.New("querying old values post mutation is not allowed")
9100 } else {
9101 value, err = m.Client().Organization.Get(ctx, id)
9102 }
9103 })
9104 return value, err
9105 }
9106 m.id = &id
9107 }
9108}
9109
9110// withOrganization sets the old Organization of the mutation.
9111func withOrganization(node *Organization) organizationOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected