   (reify
     om/IRender
     (render [_]
-      (let [{:keys [party] :as selection} (om/observe owner (selection))
-            {:keys [infos sent] :as response} (om/observe owner (response))]
-        (cond (true? sent)            (om/build rsvp-confirmation-view response)
-              (party-selected? owner) (om/build rsvp-card-view selection)
-              (seq results)           (om/build rsvp-multiple-results-view data)
-              :else                   (html [:main
-                                             [:h2 (str "Oops! No results found for '" name "'")]
-                                             [:p "Can't find your RSVP? "
-                                              [:a {:onClick #(do (.preventDefault %)
-                                                                 (reset-search! owner)
-                                                                 (reset-selection! owner))}
-                                               "Search again"]]]))))))
+      (html
+       (let [{:keys [party] :as selection} (om/observe owner (selection))
+             {:keys [infos sent] :as response} (om/observe owner (response))]
+         (cond (true? sent)
+               (om/build rsvp-confirmation-view response)
+               
+               (party-selected? owner)
+               (om/build rsvp-card-view selection)
+               
+               (seq? results)
+               (om/build rsvp-multiple-results-view data)
+               
+               :else (html [:main
+                            [:h2 (str "Oops! No results found for '" name "'")]
+                            [:p "Can't find your RSVP? "
+                             [:a {:onClick #(do (.preventDefault %)
+                                                (reset-search! owner)
+                                                (reset-selection! owner))}
+                              "Search again"]]])))))))
 
 (defn rsvp-view [{:keys [results] :as data} owner]
   (reify om/IRender

            :name "New York Loft Hostel"
            :notes "249 Varet St., Brooklyn ($)"}])]]))

(defn rsvp-search-view [{:keys [name results error] :as data} owner]
  (reify om/IRender
    (render [_]
      (html
       [:main
        [:h2 "RSVP"]
        [:form {:id "rsvpsearch"
                :onSubmit #(do (.preventDefault %)
                               (go (if (>= (count name) 3)
                                     (do (om/update! data :error nil)
                                         (let [guests (<! (search-guests name))]
                                           (om/update! data :results guests)
                                           (when (= 1 (count guests))
                                             (select-party! owner (get-in guests [0 :party])))))
                                     (om/update! data :error "Search query is too short!"))))}
         [:label {:for "guestsearch"} "Enter the name on your invitation:"]
         [:input {:type "text"
                  :name "guestseearch"
                  :class "guestsearch"
                  :placeholder "e.g. Barack and Michelle Obama"
                  :value name
                  :ref "name"
                  :onChange #(om/update! data :name (.-value (om/get-node owner "name")))}]
         (when (some? error) [:div {:class "error"} error])
         [:button {:type "submit"}
          "Find RSVP"]]]))))

(defn send-rsvps! [{:keys [party guests] :as selection} {:keys [contact food-preferences infos sent] :as response}]
  (go (try (let [[result response-or-error] (<! (parse/save Response {:party (let [p (Party.)]
                                                                               (set! (.-id p)

                         [:button
                          {:onClick #(select-party! owner party)}
                          "Select"]])
                      (unique-parties results))]
        [:p "Can't find your RSVP? "
         [:a {:onClick #(do (.preventDefault %)
                            (reset-search! owner)
