0
votes

GET is called and when referred to the handler. The result is not the data of the properties, the output is just "null". How can I output the needed value?

(ns places.core
  (:require [ajax.core :refer [GET POST]]))

(defn handler [response]
  (.log js/console (:sourceId (:_source (:hits (:hits response))))))
1

1 Answers

0
votes

The solution was to parse the raw json output like this:

(defn handler [response]
  (.log js/console
        (.. (nth (.. (JSON/parse response) -hits -hits) 0) -_source -sourceId)))