(ctx context.Context, api *API, user database.User)
| 2090 | } |
| 2091 | |
| 2092 | func userOrganizationIDs(ctx context.Context, api *API, user database.User) ([]uuid.UUID, error) { |
| 2093 | organizationIDsByMemberIDsRows, err := api.Database.GetOrganizationIDsByMemberIDs(ctx, []uuid.UUID{user.ID}) |
| 2094 | if err != nil { |
| 2095 | return []uuid.UUID{}, err |
| 2096 | } |
| 2097 | |
| 2098 | // If you are in no orgs, then return an empty list. |
| 2099 | if len(organizationIDsByMemberIDsRows) == 0 { |
| 2100 | return []uuid.UUID{}, nil |
| 2101 | } |
| 2102 | |
| 2103 | member := organizationIDsByMemberIDsRows[0] |
| 2104 | return member.OrganizationIDs, nil |
| 2105 | } |
| 2106 | |
| 2107 | func convertAPIKey(k database.APIKey) codersdk.APIKey { |
| 2108 | // Derive a single legacy scope name for response compatibility. |
no test coverage detected