chore: update get workspace profile

This commit is contained in:
Steven
2023-09-24 09:42:05 +08:00
parent 0907ad2681
commit a1d1e0f0f2
4 changed files with 32 additions and 6 deletions

View File

@ -33,7 +33,16 @@ func NewWorkspaceService(profile *profile.Profile, store *store.Store, licenseSe
func (s *WorkspaceService) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) {
profile := &apiv2pb.WorkspaceProfile{
Mode: s.Profile.Mode,
Plan: apiv2pb.PlanType_PRO,
}
// Load subscription plan from license service.
subscription, err := s.LicenseService.GetSubscription(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get subscription: %v", err)
}
profile.Plan = subscription.Plan
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &apiv2pb.GetWorkspaceSettingRequest{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get workspace setting: %v", err)