If it were me, I'd put something like:

(def add-link* [my_id fname surname day2 month2 year2 hour2 min2 zone2])

inside the function that handles the route, hit the endpoint as you would, 
and check that add-link* is receiving the arguments you expect.

On Saturday, August 1, 2015 at 3:46:47 AM UTC+10, g vim wrote:
>
> I have a route in my Luminus project: 
>
>    (POST "/add_link"  [my_id fname surname day2 month2 year2 hour2 min2 
> zone2] 
>                         (let [link (add-user-planets-aspects! [fname 
> surname nil nil nil 
>   
> (Integer/parseInt day2) (Integer/parseInt month2) (Integer/parseInt year2) 
>   
> (Integer/parseInt hour2) (Integer/parseInt min2) 0 zone2]) 
>                                your-id ((first (link :aspects-added)) 
> :user_id) 
>                                link-id ((add-link (Integer/parseInt 
> my_id) your-id "friend") :id)] 
>                            (l/render "reg_response.html" 
>                                     (if (> link-id 0) {:h2 "Link added" 
> :text (str "Link id: " link-id)} 
>                                                       {:h2 "No link 
> added" :text "There was something wrong with your link submission."})))) 
>
> In the REPL add-link does what it should but within the route it only 
> does half the job, ie. it generates a link-id but doesn't do everything 
> defined within its body: 
>
> (defn add-link [my-id your-id link-type] 
>    (let [link-id ((add-link-id my-id your-id link-type) :id) 
>          shared (add-links-aspects my-id your-id link-id) 
>          synastry (add-links-synastry my-id your-id link-id)] 
>      {:shared shared :synastry synastry :id link-id})) 
>
> I've tried (doall (add-link ....  to avoid lazy eval possibilities but 
> it didn't make any difference. What options are there for tracing what 
> add-link is doing/not doing? The app connects to a postgres database. 
>
> gvim 
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to