mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:47:33 +00:00
fix(current_sequence): no error if not found (#3740)
This commit is contained in:
@@ -4,13 +4,12 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/user"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/idp"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
||||
policy_grpc "github.com/zitadel/zitadel/internal/api/grpc/policy"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/user"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
||||
)
|
||||
|
||||
@@ -63,10 +62,17 @@ func (s *Server) AddIDPToLoginPolicy(ctx context.Context, req *admin_pb.AddIDPTo
|
||||
|
||||
func (s *Server) RemoveIDPFromLoginPolicy(ctx context.Context, req *admin_pb.RemoveIDPFromLoginPolicyRequest) (*admin_pb.RemoveIDPFromLoginPolicyResponse, error) {
|
||||
idpQuery, err := query.NewIDPUserLinkIDPIDSearchQuery(req.IdpId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
idps, err := s.query.IDPUserLinks(ctx, &query.IDPUserLinksSearchQuery{
|
||||
Queries: []query.SearchQuery{idpQuery},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
objectDetails, err := s.command.RemoveIDPProviderFromDefaultLoginPolicy(ctx, &domain.IDPProvider{IDPConfigID: req.IdpId}, user.ExternalIDPViewsToExternalIDPs(idps.Links)...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@@ -3,8 +3,6 @@ package admin
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
||||
org_grpc "github.com/zitadel/zitadel/internal/api/grpc/org"
|
||||
@@ -12,7 +10,6 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
||||
obj_pb "github.com/zitadel/zitadel/pkg/grpc/object"
|
||||
)
|
||||
|
||||
func (s *Server) IsOrgUnique(ctx context.Context, req *admin_pb.IsOrgUniqueRequest) (*admin_pb.IsOrgUniqueResponse, error) {
|
||||
@@ -38,12 +35,8 @@ func (s *Server) ListOrgs(ctx context.Context, req *admin_pb.ListOrgsRequest) (*
|
||||
return nil, err
|
||||
}
|
||||
return &admin_pb.ListOrgsResponse{
|
||||
Result: org_grpc.OrgViewsToPb(orgs.Orgs),
|
||||
Details: &obj_pb.ListDetails{
|
||||
TotalResult: orgs.Count,
|
||||
ProcessedSequence: orgs.Sequence,
|
||||
ViewTimestamp: timestamppb.New(orgs.Timestamp),
|
||||
},
|
||||
Result: org_grpc.OrgViewsToPb(orgs.Orgs),
|
||||
Details: object.ToListDetails(orgs.Count, orgs.Sequence, orgs.Timestamp),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user