mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
3025ac577b
* search orgs * org by domain * member spooler * member * get roles * tests * types duration * use default func for renew * correct database * reorder migrations * delete unused consts * move get roles to internal * use prepared org by domain * implement org in other objects * add eventstores
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/zitadel/internal/errors"
|
|
)
|
|
|
|
func (s *Server) GetOrgByID(ctx context.Context, orgID *OrgID) (*Org, error) {
|
|
org, err := s.org.OrgByID(ctx, orgID.Id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return orgFromModel(org), nil
|
|
}
|
|
|
|
func (s *Server) GetOrgByDomainGlobal(ctx context.Context, in *OrgDomain) (*Org, error) {
|
|
org, err := s.org.OrgByDomainGlobal(ctx, in.Domain)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return orgFromView(org), nil
|
|
}
|
|
|
|
func (s *Server) DeactivateOrg(ctx context.Context, in *OrgID) (*Org, error) {
|
|
org, err := s.org.DeactivateOrg(ctx, in.Id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return orgFromModel(org), nil
|
|
}
|
|
|
|
func (s *Server) ReactivateOrg(ctx context.Context, in *OrgID) (*Org, error) {
|
|
org, err := s.org.ReactivateOrg(ctx, in.Id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return orgFromModel(org), nil
|
|
}
|
|
|
|
func (s *Server) OrgChanges(ctx context.Context, changesRequest *ChangeRequest) (*Changes, error) {
|
|
return nil, errors.ThrowUnimplemented(nil, "GRPC-DNiIq", "unimplemented")
|
|
}
|