(ns wanijo.user.routes
  (:require [compojure.core :refer [defroutes GET POST]]
            [ring.util.response :as resp]
            [wanijo.infrastructure.routing :refer [register!]]
            [wanijo.user.view :as view-user]
            [wanijo.user.db :as domain]))

(defroutes routes
  (GET
   (register! :user-profile "/user/profile")
   [:as req]
   (view-user/profile!
    req
    (domain/find! (get-in req [:session :ident]))))
  (POST (register! :user-edit "/user/edit")
        []
        (fn [req])))
