Skip to content
Snippets Groups Projects
Commit 90da1ca7 authored by Kyle Doherty's avatar Kyle Doherty
Browse files

Merge branch 'kdoh_setup_flow' of github.com:metabase/metabase-init into kdoh_setup_flow

parents ebc54aa2 a1dd8457
No related branches found
No related tags found
No related merge requests found
......@@ -34,13 +34,12 @@
;Stub function that will eventually validate a connection string
(defendpoint POST "/validate" [:as {{:keys [host port]} :body}]
(require-params host port)
(let [response-invalid (fn [m] {:status 400 :body {:valid false :message m}})
port (Integer/parseInt port)]
(cond
(not (u/host-up? host)) (response-invalid "Host not reachable")
(not (u/host-port-up? host port)) (response-invalid "Invalid port")
(= (rand-int 2) 1) (response-invalid "Invalid User or Password")
:else {:valid true} )))
(let [response-invalid (fn [m] {:status 400 :body {:valid false :message m}})]
(cond
(not (u/host-up? host)) (response-invalid "Host not reachable")
(not (u/host-port-up? host port)) (response-invalid "Invalid port")
(= (rand-int 2) 1) (response-invalid "Invalid User or Password")
:else {:valid true})))
(defendpoint GET "/:id" [id]
(->404 (sel :one Database :id id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment