mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:37:31 +00:00
fix: action query (#4257)
This commit is contained in:
@@ -111,9 +111,13 @@ func ActionStateToPb(state domain.ActionState) action_pb.ActionState {
|
||||
func ActionNameQuery(q *action_pb.ActionNameQuery) (query.SearchQuery, error) {
|
||||
return query.NewActionNameSearchQuery(object_grpc.TextMethodToQuery(q.Method), q.Name)
|
||||
}
|
||||
|
||||
func ActionStateQuery(q *action_pb.ActionStateQuery) (query.SearchQuery, error) {
|
||||
return query.NewActionStateSearchQuery(ActionStateToDomain(q.State))
|
||||
}
|
||||
func ActionIDQuery(q *action_pb.ActionIDQuery) (query.SearchQuery, error) {
|
||||
return query.NewActionIDSearchQuery(q.Id)
|
||||
}
|
||||
|
||||
func ActionStateToDomain(state action_pb.ActionState) domain.ActionState {
|
||||
switch state {
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
action_grpc "github.com/zitadel/zitadel/internal/api/grpc/action"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
mgmt_pb "github.com/zitadel/zitadel/pkg/grpc/management"
|
||||
@@ -59,6 +60,8 @@ func ActionQueryToQuery(query interface{}) (query.SearchQuery, error) {
|
||||
return action_grpc.ActionNameQuery(q.ActionNameQuery)
|
||||
case *mgmt_pb.ActionQuery_ActionStateQuery:
|
||||
return action_grpc.ActionStateQuery(q.ActionStateQuery)
|
||||
case *mgmt_pb.ActionQuery_ActionIdQuery:
|
||||
return action_grpc.ActionIDQuery(q.ActionIdQuery)
|
||||
}
|
||||
return nil, nil
|
||||
return nil, errors.ThrowInvalidArgument(nil, "MGMT-dsg3z", "Errors.Query.InvalidRequest")
|
||||
}
|
||||
|
Reference in New Issue
Block a user