(ctx context.Context, orgID uuid.UUID)
| 138 | } |
| 139 | |
| 140 | func (r *OrgInvitation) ListByOrg(ctx context.Context, orgID uuid.UUID) ([]*biz.OrgInvitation, error) { |
| 141 | ctx, span := otelx.Start(ctx, orgInvitationRepoTracer, "OrgInvitation.ListByOrg") |
| 142 | defer span.End() |
| 143 | |
| 144 | invite, err := r.query().Where(orginvitation.OrganizationID(orgID)).All(ctx) |
| 145 | if err != nil { |
| 146 | return nil, fmt.Errorf("error finding invites for org %s: %w", orgID.String(), err) |
| 147 | } |
| 148 | |
| 149 | res := make([]*biz.OrgInvitation, len(invite)) |
| 150 | for i, v := range invite { |
| 151 | res[i] = entInviteToBiz(v) |
| 152 | } |
| 153 | |
| 154 | return res, nil |
| 155 | } |
| 156 | |
| 157 | func entInviteToBiz(i *ent.OrgInvitation) *biz.OrgInvitation { |
| 158 | if i == nil { |
nothing calls this directly
no test coverage detected