 (defn endorsement-list [badge-id]
   (let [state (atom {:id badge-id})]
     (init-user-badge-endorsement state)
-
     (fn []
       (when (seq @(cursor state [:user-badge-endorsements]))
         [:div

                                                :aria-label "OK"
                                                :class "close"
                                                :on-click #(do (.preventDefault %)
                                                             (delete-endorsement id user_badge_id state))
                                                }
                                       [:i.fa.fa-trash.trash]]]]
                               [:div.panel-body

    (path-for "/obpv1/badge/user/pending_endorsement/")
    {:handler (fn [data]
                (swap! state assoc :pending data)
                )}))

(defn edit-endorsement [id badge-id content]
  (ajax/POST
    (path-for (str "/obpv1/badge/endorsement/edit/" id))
    {:params {:content content
              :user_badge_id badge-id}
     :handler (fn [data]
                (when (= "success" (:status data))
                  (prn data)
                  ))}))

(defn save-endorsement [state]
  (ajax/POST
