Commits

Steve Losh  committed 9a3a49a

Check searches.

  • Participants
  • Parent commits 9275d33

Comments (0)

Files changed (1)

File src/newseasons/views/main.clj

 ; Search ----------------------------------------------------------------------
 (defpage [:get "/search"] {:keys [query]}
   (login-required
-    (let [results (unique-shows (itunes-search-show query))]
-      (shows/store-raw-shows results)
-      (t/search query results))))
+    (if (empty? query)
+      (do (flash! "Please enter something to search for.")
+        (resp/redirect "/")) 
+      (let [results (unique-shows (itunes-search-show query))]
+        (shows/store-raw-shows results)
+        (t/search query results)))))
 
 
 ; Add -------------------------------------------------------------------------