diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-15 13:46:15 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-15 13:46:15 +0530 |
commit | 9b3d6d0ec5ecb9d73b518d786a22cb3ff7f3768f (patch) | |
tree | 68c970ee46f6c572f4389573921c5e20a2992a4e /anime_list.go | |
parent | d0d0d0cdc4218f1f944481a5116c74d81682deff (diff) |
added validators for getting users' lists
Diffstat (limited to 'anime_list.go')
-rw-r--r-- | anime_list.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/anime_list.go b/anime_list.go index 0d8a0ff..9d0f370 100644 --- a/anime_list.go +++ b/anime_list.go @@ -43,8 +43,13 @@ func (c Client) DeleteAnime(id int) error { } func (c Client) GetAnimeList(animes *[]Anime, params *ListParams) (bool, error) { - // TODO: validate params - //params.Fields = append(params.Fields, "list_status") + err := validateAnimeListParams(params) + if err != nil { + return false, err + } + + params.Fields = append(params.Fields, "list_status") + var res struct { Data []struct { Anime Anime `json:"node"` |