diff --git a/internal/domain/player.go b/internal/domain/player.go index 4cca029..3636f8d 100644 --- a/internal/domain/player.go +++ b/internal/domain/player.go @@ -875,7 +875,7 @@ func (params *ListPlayersParams) Names() []string { } const ( - playerNamesMinLength = 1 + playerNamesMinLength = 0 playerNamesMaxLength = 100 ) diff --git a/internal/domain/player_test.go b/internal/domain/player_test.go index 8e4115d..6ae5384 100644 --- a/internal/domain/player_test.go +++ b/internal/domain/player_test.go @@ -674,21 +674,6 @@ func TestListPlayersParams_SetNames(t *testing.T) { }, }, }, - { - name: "ERR: len(names) < 1", - args: args{ - names: nil, - }, - expectedErr: domain.ValidationError{ - Model: "ListPlayersParams", - Field: "names", - Err: domain.LenOutOfRangeError{ - Min: 1, - Max: 100, - Current: 0, - }, - }, - }, { name: "ERR: len(names) > 100", args: args{ @@ -704,7 +689,7 @@ func TestListPlayersParams_SetNames(t *testing.T) { Model: "ListPlayersParams", Field: "names", Err: domain.LenOutOfRangeError{ - Min: 1, + Min: 0, Max: 100, Current: 101, }, diff --git a/internal/domain/tribe.go b/internal/domain/tribe.go index c51d184..424ed60 100644 --- a/internal/domain/tribe.go +++ b/internal/domain/tribe.go @@ -810,7 +810,7 @@ func (params *ListTribesParams) Tags() []string { } const ( - tribeTagsMinLength = 1 + tribeTagsMinLength = 0 tribeTagsMaxLength = 100 ) diff --git a/internal/domain/tribe_test.go b/internal/domain/tribe_test.go index 67a2ddc..7da683c 100644 --- a/internal/domain/tribe_test.go +++ b/internal/domain/tribe_test.go @@ -614,21 +614,6 @@ func TestListTribesParams_SetTags(t *testing.T) { }, }, }, - { - name: "ERR: len(tags) < 1", - args: args{ - tags: nil, - }, - expectedErr: domain.ValidationError{ - Model: "ListTribesParams", - Field: "tags", - Err: domain.LenOutOfRangeError{ - Min: 1, - Max: 100, - Current: 0, - }, - }, - }, { name: "ERR: len(tags) > 100", args: args{ @@ -644,7 +629,7 @@ func TestListTribesParams_SetTags(t *testing.T) { Model: "ListTribesParams", Field: "tags", Err: domain.LenOutOfRangeError{ - Min: 1, + Min: 0, Max: 100, Current: 101, }, diff --git a/internal/port/handler_http_api_player_test.go b/internal/port/handler_http_api_player_test.go index 7311f52..e051f83 100644 --- a/internal/port/handler_http_api_player_test.go +++ b/internal/port/handler_http_api_player_test.go @@ -583,7 +583,7 @@ func TestListPlayers(t *testing.T) { // body body := decodeJSON[apimodel.ErrorResponse](t, resp.Body) domainErr := domain.LenOutOfRangeError{ - Min: 1, + Min: 0, Max: 100, Current: len(req.URL.Query()["name"]), } diff --git a/internal/port/handler_http_api_tribe_test.go b/internal/port/handler_http_api_tribe_test.go index e63da6e..96cbc39 100644 --- a/internal/port/handler_http_api_tribe_test.go +++ b/internal/port/handler_http_api_tribe_test.go @@ -583,7 +583,7 @@ func TestListTribes(t *testing.T) { // body body := decodeJSON[apimodel.ErrorResponse](t, resp.Body) domainErr := domain.LenOutOfRangeError{ - Min: 1, + Min: 0, Max: 100, Current: len(req.URL.Query()["tag"]), }