        [:main
         [:h2 "RSVP"]
         [:form {:id "rsvpsearch"
-                :onSubmit #(do (.. % (preventDefault))
+                :onSubmit #(do (.preventDefault %)
                                (go (if (>= (count name) 3)
                                      (do (om/update! data :error nil)
                                          (let [guests (<! (search-guests name))]

(defonce Guest (.extend (.-Object parse/Parse) "Guest"))

(defn save-parties [parties]
  (go (doseq [{:keys [names contact has-plus-one]} parties]
        (let [party (<! (parse/save Party {:contact contact
                                           :additional (if has-plus-one 1 0)}))]
          (doseq [name names]
            (<! (parse/save Guest {:name name
                                   :party party})))))))

(defn search-guests [search-str]
  (go (if-let [result (<! (-> (parse/query Guest)
                              (parse/matches "name" search-str {:insensitive true})
                              (parse/include "party")
                              (parse/query-find)))]
        (-> (mapv (fn [guest]
                    (-> guest
                        (parse/parse-obj->map)
                        (update-in [:party] parse/parse-obj->map)))
                  (js->clj result)))
        [])))

(defn guests-in-party [party-id]
  (go (if-let [result (<! (-> (parse/query Guest)

        [:ul {:id "rsvpresults"}
         (map-indexed (fn [n {:keys [name party]}]
                        [:li
                         [:span (get-in party [:title])]
                         [:button
                          {:onClick #(select-party! owner party)}
                          "Select"]])
