handles home page
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -73,8 +73,17 @@
|
|||||||
(defn render-index [_]
|
(defn render-index [_]
|
||||||
(response/resource-response "index.html" {:root "public"}))
|
(response/resource-response "index.html" {:root "public"}))
|
||||||
|
|
||||||
|
(defn home-handler [{:keys [identity]}]
|
||||||
|
(if identity
|
||||||
|
{:status 302
|
||||||
|
:headers {"Location" "/dashboard"}}
|
||||||
|
{:status 302
|
||||||
|
:headers {"Location" "/login"}}))
|
||||||
|
|
||||||
|
|
||||||
(def match->handler-lookup
|
(def match->handler-lookup
|
||||||
(-> {:not-found not-found}
|
(-> {:not-found not-found
|
||||||
|
:home home-handler}
|
||||||
(merge ssr/key->handler)
|
(merge ssr/key->handler)
|
||||||
(merge graphql/match->handler)
|
(merge graphql/match->handler)
|
||||||
(merge ezcater/match->handler)
|
(merge ezcater/match->handler)
|
||||||
|
|||||||
@@ -642,5 +642,3 @@
|
|||||||
(partition-all 1000))]
|
(partition-all 1000))]
|
||||||
(print ".")
|
(print ".")
|
||||||
@(dc/transact auto-ap.datomic/conn n)))
|
@(dc/transact auto-ap.datomic/conn n)))
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
[auto-ap.routes.admin.sales-summaries :as ss-routes]
|
[auto-ap.routes.admin.sales-summaries :as ss-routes]
|
||||||
[auto-ap.routes.admin.transaction-rules :as tr-routes]))
|
[auto-ap.routes.admin.transaction-rules :as tr-routes]))
|
||||||
|
|
||||||
(def routes {"impersonate" :impersonate
|
(def routes {"" :home
|
||||||
|
"impersonate" :impersonate
|
||||||
"logout" :logout
|
"logout" :logout
|
||||||
"login" :login
|
"login" :login
|
||||||
"search" :search
|
"search" :search
|
||||||
|
|||||||
Reference in New Issue
Block a user