mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-11 02:13:41 +09:00
GO-4969: Fix spaces list condition showing deleted spaces
This commit is contained in:
parent
3139e38c23
commit
98a6162e97
2 changed files with 42 additions and 12 deletions
|
@ -44,8 +44,13 @@ func (s *Service) ListSpaces(ctx context.Context, offset int, limit int) (spaces
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Sorts: []*model.BlockContentDataviewSort{
|
||||
|
@ -92,8 +97,13 @@ func (s *Service) GetSpace(ctx context.Context, spaceId string) (apimodel.Space,
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Keys: []string{bundle.RelationKeyTargetSpaceId.String()},
|
||||
|
|
|
@ -34,8 +34,13 @@ func TestSpaceService_ListSpaces(t *testing.T) {
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Sorts: []*model.BlockContentDataviewSort{
|
||||
|
@ -214,8 +219,13 @@ func TestSpaceService_GetSpace(t *testing.T) {
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Keys: []string{
|
||||
|
@ -289,8 +299,13 @@ func TestSpaceService_GetSpace(t *testing.T) {
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Keys: []string{bundle.RelationKeyTargetSpaceId.String()},
|
||||
|
@ -321,8 +336,13 @@ func TestSpaceService_GetSpace(t *testing.T) {
|
|||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceLocalStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
Value: pbtypes.Int64(int64(model.SpaceStatus_Ok)),
|
||||
Condition: model.BlockContentDataviewFilter_In,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_Unknown), int(model.SpaceStatus_Ok)),
|
||||
},
|
||||
{
|
||||
RelationKey: bundle.RelationKeySpaceRemoteStatus.String(),
|
||||
Condition: model.BlockContentDataviewFilter_NotIn,
|
||||
Value: pbtypes.IntList(int(model.SpaceStatus_RemoteDeleted), int(model.SpaceStatus_SpaceDeleted)),
|
||||
},
|
||||
},
|
||||
Keys: []string{bundle.RelationKeyTargetSpaceId.String()},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue