mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
7a6ca24625
* check uniqueness on create and register user * change user email, reserve release unique email * usergrant unique aggregate * usergrant uniqueness * validate UserGrant * fix tests * domain is set on username in all orgs * domain in admin * org domain sql * zitadel domain org name * org domains * org iam policy * default org iam policy * SETUP * load login names * login by login name * login name * fix: merge master * fix: merge master * Update internal/user/repository/eventsourcing/user.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: fix unique domains * fix: rename env variable Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
30 lines
855 B
Go
30 lines
855 B
Go
package eventstore
|
|
|
|
import (
|
|
"context"
|
|
auth_view "github.com/caos/zitadel/internal/auth/repository/eventsourcing/view"
|
|
org_model "github.com/caos/zitadel/internal/org/model"
|
|
org_es "github.com/caos/zitadel/internal/org/repository/eventsourcing"
|
|
"github.com/caos/zitadel/internal/org/repository/view/model"
|
|
)
|
|
|
|
type OrgRepository struct {
|
|
SearchLimit uint64
|
|
*org_es.OrgEventstore
|
|
View *auth_view.View
|
|
}
|
|
|
|
func (repo *OrgRepository) SearchOrgs(ctx context.Context, request *org_model.OrgSearchRequest) (*org_model.OrgSearchResult, error) {
|
|
request.EnsureLimit(repo.SearchLimit)
|
|
members, count, err := repo.View.SearchOrgs(request)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &org_model.OrgSearchResult{
|
|
Offset: request.Offset,
|
|
Limit: request.Limit,
|
|
TotalResult: uint64(count),
|
|
Result: model.OrgsToModel(members),
|
|
}, nil
|
|
}
|