aboutsummaryrefslogtreecommitdiff
path: root/errhandlers
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2022-02-28 05:35:39 +0000
committerGitHub <noreply@github.com>2022-02-28 05:35:39 +0000
commit06425ac756f916bca10d0f8797cf575a77dcf69d (patch)
tree7b4df51906c714f83a2bdce710e218a5cbb6672e /errhandlers
parentf44303ee9de8da4e330116d2c6e6048d59b52526 (diff)
parent38f7861cc533081aba7458ef52a25acdeddd1f16 (diff)
Merge pull request #7 from MikunoNaka/user-mangalist
Added functionality to update manga lists
Diffstat (limited to 'errhandlers')
-rw-r--r--errhandlers/manga_validators.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/errhandlers/manga_validators.go b/errhandlers/manga_validators.go
index fa12e5f..e54107d 100644
--- a/errhandlers/manga_validators.go
+++ b/errhandlers/manga_validators.go
@@ -68,3 +68,29 @@ func IsValidMangaRankingType(rankingType string) bool {
}
return false
}
+
+// Checks if given sort is valid
+func IsValidMangaListSort(sort string) bool {
+ switch sort {
+ case
+ "list_score",
+ "list_updated_at",
+ "manga_title",
+ "manga_start_date",
+ "manga_id": return true
+ }
+ return false
+}
+
+// Checks if given list status is valid
+func IsValidMangaListStatus(status string) bool {
+ switch status {
+ case
+ "reading",
+ "completed",
+ "on_hold",
+ "dropped",
+ "plan_to_read": return true
+ }
+ return false
+}