(ctx context.Context, userID, afterName string, limit int)
| 66 | } |
| 67 | |
| 68 | func (c *connection) FindOrganizationsForUser(ctx context.Context, userID, afterName string, limit int) ([]*database.Organization, error) { |
| 69 | var res []*database.Organization |
| 70 | err := c.getDB(ctx).SelectContext(ctx, &res, ` |
| 71 | SELECT o.* FROM orgs o |
| 72 | WHERE o.id IN (SELECT uor.org_id FROM users_orgs_roles uor WHERE uor.user_id = $1) |
| 73 | AND lower(o.name) > lower($2) ORDER BY lower(o.name) LIMIT $3 |
| 74 | `, userID, afterName, limit) |
| 75 | if err != nil { |
| 76 | return nil, parseErr("orgs", err) |
| 77 | } |
| 78 | return res, nil |
| 79 | } |
| 80 | |
| 81 | func (c *connection) FindOrganization(ctx context.Context, orgID string) (*database.Organization, error) { |
| 82 | res := &database.Organization{} |
nothing calls this directly
no test coverage detected