mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 13:07:23 +00:00

* fix: change to repository event types and removed unused code * some fixes * remove unused code
22 lines
637 B
Go
22 lines
637 B
Go
package view
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/errors"
|
|
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
|
|
"github.com/caos/zitadel/internal/repository/user"
|
|
)
|
|
|
|
func UserByIDQuery(id string, latestSequence uint64) (*es_models.SearchQuery, error) {
|
|
if id == "" {
|
|
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-d8isw", "Errors.User.UserIDMissing")
|
|
}
|
|
return UserQuery(latestSequence).
|
|
AggregateIDFilter(id), nil
|
|
}
|
|
|
|
func UserQuery(latestSequence uint64) *es_models.SearchQuery {
|
|
return es_models.NewSearchQuery().
|
|
AggregateTypeFilter(user.AggregateType).
|
|
LatestSequenceFilter(latestSequence)
|
|
}
|