mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
21 lines
621 B
Go
21 lines
621 B
Go
package view
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
es_models "github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
|
"github.com/zitadel/zitadel/internal/repository/user"
|
|
)
|
|
|
|
func UserByIDQuery(id, instanceID string, latestSequence uint64) (*es_models.SearchQuery, error) {
|
|
if id == "" {
|
|
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-d8isw", "Errors.User.UserIDMissing")
|
|
}
|
|
return es_models.NewSearchQuery().
|
|
AddQuery().
|
|
AggregateTypeFilter(user.AggregateType).
|
|
AggregateIDFilter(id).
|
|
LatestSequenceFilter(latestSequence).
|
|
InstanceIDFilter(instanceID).
|
|
SearchQuery(), nil
|
|
}
|