From 46fa546a7df4be765905bfc1b7e7e430634c79ca Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 24 Sep 2023 19:31:23 +0800 Subject: [PATCH] chore: update workspace setting store --- api/v2/workspace_service.go | 2 +- server/service/license/license.go | 3 +-- store/workspace_setting.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/v2/workspace_service.go b/api/v2/workspace_service.go index 71b59ca..17700af 100644 --- a/api/v2/workspace_service.go +++ b/api/v2/workspace_service.go @@ -33,7 +33,7 @@ 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, + Plan: apiv2pb.PlanType_FREE, } // Load subscription plan from license service. diff --git a/server/service/license/license.go b/server/service/license/license.go index 74f7f0f..96a7c06 100644 --- a/server/service/license/license.go +++ b/server/service/license/license.go @@ -39,8 +39,7 @@ func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv2pb.Subscri return nil, errors.Wrap(err, "failed to get workspace setting") } subscription := &apiv2pb.Subscription{ - // NOTE: Default to pro plan for now. - Plan: apiv2pb.PlanType_PRO, + Plan: apiv2pb.PlanType_FREE, } licenseKey := "" if workspaceSetting != nil { diff --git a/store/workspace_setting.go b/store/workspace_setting.go index 6109f8d..fb623f8 100644 --- a/store/workspace_setting.go +++ b/store/workspace_setting.go @@ -111,7 +111,7 @@ func (s *Store) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSe } workspaceSetting.Value = &storepb.WorkspaceSetting_AutoBackup{AutoBackup: autoBackupSetting} } else { - return nil, errors.New("invalid workspace setting key") + continue } list = append(list, workspaceSetting) }