mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: handle legacy workspace setting
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user