             [metabase.models
              [card :refer [Card]]
              [dashboard :as dashboard :refer [Dashboard]]
+             [dashboard-card :refer [create-dashboard-card! DashboardCard delete-dashboard-card! update-dashboard-card!]]
              [dashboard-favorite :refer [DashboardFavorite]]
-             [dashboard-card :refer [create-dashboard-card! DashboardCard delete-dashboard-card! update-dashboard-card!]]
              [interface :as mi]
              [revision :as revision]]
             [metabase.util.schema :as su]

(defn- dashboards-list [filter-option]
  (as-> (db/select Dashboard {:where    [:and (case (or (keyword filter-option) :all)
                                                :all  true
                                                :mine [:= :creator_id *current-user-id*])
                                              [:= :archived (= (keyword filter-option) :archived)]]
    (hydrate <> :creator)
    (filter mi/can-read? <>)
    (hydrate-favorites <>)))))

(api/defendpoint GET "/"
  "Get `Dashboards`. With filter option `f` (default `all`), restrict results as follows:

(ns metabase.api.dashboard
  "/api/dashboard endpoints."
  (:require [clojure.tools.logging :as log]
            [compojure.core :refer [DELETE GET POST PUT]]
            [metabase
             [events :as events]
             [util :as u]]
