mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
1c839e308b
* feat: support list milestones api * show milestones in onboarding view * add authenticated milestone * add icon to login milestone * update main * lint * fix import * fix import * lint * reuse proto milestone type mapping
25 lines
757 B
Go
25 lines
757 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
object_pb "github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
|
)
|
|
|
|
func (s *Server) ListMilestones(ctx context.Context, req *admin.ListMilestonesRequest) (*admin.ListMilestonesResponse, error) {
|
|
queries, err := listMilestonesToModel(authz.GetInstance(ctx).InstanceID(), req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
resp, err := s.query.SearchMilestones(ctx, []string{authz.GetInstance(ctx).InstanceID()}, queries)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &admin.ListMilestonesResponse{
|
|
Result: milestoneViewsToPb(resp.Milestones),
|
|
Details: object_pb.ToListDetails(resp.Count, resp.Sequence, resp.LastRun),
|
|
}, nil
|
|
}
|