diff --git a/server/integrationtests/boards_and_blocks_test.go b/server/integrationtests/boards_and_blocks_test.go index f0079dd5d..739818811 100644 --- a/server/integrationtests/boards_and_blocks_test.go +++ b/server/integrationtests/boards_and_blocks_test.go @@ -693,16 +693,6 @@ func TestDeleteBoardsAndBlocks(t *testing.T) { require.False(t, success) }) - t.Run("no blocks", func(t *testing.T) { - dbab := &model.DeleteBoardsAndBlocks{ - Boards: []string{board.ID}, - } - - success, resp := th.Client.DeleteBoardsAndBlocks(dbab) - th.CheckBadRequest(resp) - require.False(t, success) - }) - t.Run("boards from different teams", func(t *testing.T) { newOtherTeamsBoard := &model.Board{ TeamID: "another-team-id", diff --git a/server/model/boards_and_blocks.go b/server/model/boards_and_blocks.go index fecbc9dfc..377dd247e 100644 --- a/server/model/boards_and_blocks.go +++ b/server/model/boards_and_blocks.go @@ -94,10 +94,6 @@ func (dbab *DeleteBoardsAndBlocks) IsValid() error { return ErrNoBoardsInBoardsAndBlocks } - if len(dbab.Blocks) == 0 { - return ErrNoBlocksInBoardsAndBlocks - } - return nil } @@ -131,10 +127,6 @@ func (dbab *PatchBoardsAndBlocks) IsValid() error { return ErrBoardIDsAndPatchesMissmatchInBoardsAndBlocks } - if len(dbab.BlockIDs) == 0 { - return ErrNoBlocksInBoardsAndBlocks - } - if len(dbab.BlockIDs) != len(dbab.BlockPatches) { return ErrBlockIDsAndPatchesMissmatchInBoardsAndBlocks } diff --git a/server/model/boards_and_blocks_test.go b/server/model/boards_and_blocks_test.go index 1a8c01a8a..ae1815ce4 100644 --- a/server/model/boards_and_blocks_test.go +++ b/server/model/boards_and_blocks_test.go @@ -183,19 +183,6 @@ func TestIsValidPatchBoardsAndBlocks(t *testing.T) { require.ErrorIs(t, pbab.IsValid(), ErrBoardIDsAndPatchesMissmatchInBoardsAndBlocks) }) - t.Run("no block ids", func(t *testing.T) { - pbab := &PatchBoardsAndBlocks{ - BoardIDs: []string{"board-id-1", "board-id-2"}, - BoardPatches: []*BoardPatch{ - {Title: &newTitle}, - {Description: &newDescription}, - }, - BlockIDs: []string{}, - } - - require.ErrorIs(t, pbab.IsValid(), ErrNoBlocksInBoardsAndBlocks) - }) - t.Run("missmatch block IDs and patches", func(t *testing.T) { pbab := &PatchBoardsAndBlocks{ BoardIDs: []string{"board-id-1", "board-id-2"},