diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-05 21:52:30 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-05 21:52:30 +0530 |
commit | f3ec24145da97fa7e4a5687503a6f46d59ff8c2a (patch) | |
tree | dd8f63a52b862b2ba64d562230da087d727d0fd2 /anime/validators.go | |
parent | b876e67c2b21631231a06a4f7c929cb212d01595 (diff) |
added function to get seasonal anime and added fields support to all the endpoints that have it
Diffstat (limited to 'anime/validators.go')
-rw-r--r-- | anime/validators.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/anime/validators.go b/anime/validators.go index 416f827..7f6a7cc 100644 --- a/anime/validators.go +++ b/anime/validators.go @@ -73,3 +73,24 @@ func isValidField(field string) bool { return false } +// Checks if given season is valid +func isValidSeason(season string) bool { + switch season { + case + "winter", + "spring", + "summer", + "fall": return true + } + return false +} + +// Checks if given sort is valid +func isValidSort(sort string) bool { + switch sort { + case + "anime_score", + "anime_num_list_users": return true + } + return false +} |