Send 406 on no search query
This commit is contained in:
parent
651e0f6065
commit
e62d6877ad
|
@ -130,6 +130,9 @@ routes:
|
||||||
query = @"q".toLower
|
query = @"q".toLower
|
||||||
eps: seq[Episode]
|
eps: seq[Episode]
|
||||||
|
|
||||||
|
if query == "":
|
||||||
|
halt Http406, myHeaders, $ %* { "error": "Need to specify query" }
|
||||||
|
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
if episode.name.toLower.contains query:
|
if episode.name.toLower.contains query:
|
||||||
eps = eps & episode
|
eps = eps & episode
|
||||||
|
|
Loading…
Reference in New Issue