       ;; Org operations
       (ANY "/orgs/:slug" [slug] (pool/with-pool [conn db-pool] (org conn slug)))
       (ANY "/orgs/:slug/" [slug] (pool/with-pool [conn db-pool] (org conn slug)))
+      ;; Orgs by team
+      (OPTIONS "/orgs-team/:team-id" [team-id] (pool/with-pool [conn db-pool] (println "DBG here OPTIONS team-id" team-id) (orgs-team conn team-id)))
+      (GET "/orgs-team/:team-id" [team-id] (pool/with-pool [conn db-pool] (println "DBG here team-id" team-id) (orgs-team conn team-id)))
       ;; Org author operations
       (OPTIONS "/orgs/:slug/authors" [slug] (pool/with-pool [conn db-pool] (author conn slug nil)))
       (OPTIONS "/orgs/:slug/authors/" [slug] (pool/with-pool [conn db-pool] (author conn slug nil)))

  :handle-unprocessable-entity (fn [ctx]
    (api-common/unprocessable-entity-response (schema/check common-res/Org (:updated-org ctx)))))

;; A resource for the authors of a particular org
(defresource author [conn org-slug user-id]
  (api-common/open-company-authenticated-resource config/passphrase) ; verify validity and presence of required JWToken

            [clj-time.core :as t]
            [clj-time.format :as f]
            [taoensso.timbre :as timbre]
            [compojure.core :as compojure :refer (ANY OPTIONS GET POST DELETE)]
            [liberator.core :refer (defresource by-method)]
            [schema.core :as schema]
            [oc.lib.time :as lib-time]
