                         [:li
                          [:span name]
                          [:button
-                          {:onClick (fn [_]
-                                      (go (om/update! data :party (assoc party
-                                                                         :guests (<! (guests-in-party (:id party)))))))}
+                          {:onClick #(select-party! owner party)}
                           "Select"]])
                       results)]
         [:p "Can't find your RSVP? "
-          [:a {:href "???"} "Search again"]]]))))
+         [:a {:onClick #(do (.preventDefault %)
+                            (reset-search! owner)
+                            (reset-selection! owner))}
+          "Search again"]]]))))
 
 (defn rsvp-confirmation-view [response owner]
   (om/component

              (map (fn [[key text]]
                     [:li (if (= selected [key]) {:class "selected"} {})
                      [:a {:href "#"
                           :onClick #(do (om/update! rsvp-search :results nil)
                                         (om/update! rsvp-search :guests-in-party nil)
                                         (om/update! rsvp-search :party nil)
                                         (om/update! selected 0 key))}
                       text]])
                   (partition 2 [:details       "Details"

(defonce app-state
  (atom {:selected [:details]
         :rsvp-search {:name ""
                       :results nil
                       :party {}}
         :party {}
         :selection {:party nil
                     :guests nil}
         :response {:contact nil
                    :food-preferences ""
                    :infos {}
                    :sent false}}))

(defn search []
  (om/ref-cursor (:rsvp-search (om/root-cursor app-state))))

(defn selection []
  (om/ref-cursor (get-in (om/root-cursor app-state) [:selection])))

(defn response []
  (om/ref-cursor (get-in (om/root-cursor app-state) [:response])))

(defonce Response (.extend (.-Object parse/Parse) "Response"))
(defonce Info (.extend (.-Object parse/Parse) "Info"))
