mirror of
https://github.com/usememos/memos.git
synced 2025-03-11 04:53:02 +08:00
chore: handle legacy workspace setting
This commit is contained in:
parent
a73f979f96
commit
e16546f80a
2 changed files with 6 additions and 2 deletions
|
@ -73,7 +73,7 @@ func (s *APIV1Service) ListMemoResources(ctx context.Context, request *v1pb.List
|
|||
MemoID: &id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to list resources")
|
||||
return nil, status.Errorf(codes.Internal, "failed to list resources: %v", err)
|
||||
}
|
||||
|
||||
response := &v1pb.ListMemoResourcesResponse{
|
||||
|
|
|
@ -69,6 +69,9 @@ func (s *Store) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSe
|
|||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Failed to convert workspace setting")
|
||||
}
|
||||
if workspaceSetting == nil {
|
||||
continue
|
||||
}
|
||||
s.workspaceSettingCache.Store(workspaceSetting.Key.String(), workspaceSetting)
|
||||
workspaceSettings = append(workspaceSettings, workspaceSetting)
|
||||
}
|
||||
|
@ -206,7 +209,8 @@ func convertWorkspaceSettingFromRaw(workspaceSettingRaw *WorkspaceSetting) (*sto
|
|||
}
|
||||
workspaceSetting.Value = &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: memoRelatedSetting}
|
||||
default:
|
||||
return nil, errors.Errorf("unsupported workspace setting key: %v", workspaceSettingRaw.Name)
|
||||
// Skip unsupported workspace setting key.
|
||||
return nil, nil
|
||||
}
|
||||
return workspaceSetting, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue