 
         :else nil))
 
-(defn update-account [{:keys [params session]}]
+(defn update-account [{:keys [params]}]
   (let [user-id               (:userId params -1)
         current-email         (:userName params)
         current-password      (:currentPassword params)


(defn login [{:keys [params]}]
  (let [{:keys [email password]} params]
    (if-let [user (first (call-sql "check_login" email password))]
      (data-response ""
                     {:session {:userId   (:user_id user)
                                :userName email


;; FIXME, remove this route and check if a user exists directly when adding
(defn get-all-users [_]
  (let [all-users (mapv (fn [{:keys [user_id email]}]
                          {:id    user_id
                           :email email})
                        (call-sql "get_all_users"))]
    (data-response all-users)))

;; FIXME: Update get_all_users_by_institution to remove unused values.
(defn get-institution-users [{:keys [params]}]
  (let [institution-id (tc/str->int (:institutionId params))
        all-users      (mapv (fn [{:keys [user_id email institution_role]}]
                               {:id              user_id
                                :email           email
                                :institutionRole institution_role})
                             (call-sql "get_all_users_by_institution_id" institution-id))]
    (data-response all-users)))
