mirror of
https://github.com/usememos/memos.git
synced 2025-12-09 13:46:24 +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,
|
MemoID: &id,
|
||||||
})
|
})
|
||||||
if err != nil {
|
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{
|
response := &v1pb.ListMemoResourcesResponse{
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,9 @@ func (s *Store) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSe
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "Failed to convert workspace setting")
|
return nil, errors.Wrap(err, "Failed to convert workspace setting")
|
||||||
}
|
}
|
||||||
|
if workspaceSetting == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
s.workspaceSettingCache.Store(workspaceSetting.Key.String(), workspaceSetting)
|
s.workspaceSettingCache.Store(workspaceSetting.Key.String(), workspaceSetting)
|
||||||
workspaceSettings = append(workspaceSettings, workspaceSetting)
|
workspaceSettings = append(workspaceSettings, workspaceSetting)
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +209,8 @@ func convertWorkspaceSettingFromRaw(workspaceSettingRaw *WorkspaceSetting) (*sto
|
||||||
}
|
}
|
||||||
workspaceSetting.Value = &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: memoRelatedSetting}
|
workspaceSetting.Value = &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: memoRelatedSetting}
|
||||||
default:
|
default:
|
||||||
return nil, errors.Errorf("unsupported workspace setting key: %v", workspaceSettingRaw.Name)
|
// Skip unsupported workspace setting key.
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
return workspaceSetting, nil
|
return workspaceSetting, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue