Skip to content
Snippets Groups Projects
Commit 497ba768 authored by Tom Robinson's avatar Tom Robinson
Browse files

Implement missing DELETE /api/meta/fk/:id endpoint

parent c48795b6
No related branches found
No related tags found
No related merge requests found
(ns metabase.api.meta.fk
"/api/meta/fk endpoints."
(:require [compojure.core :refer [DELETE]]
[metabase.api.common :refer :all]
[metabase.db :refer :all]
(metabase.models [foreign-key :refer [ForeignKey]])
[metabase.driver :as driver]))
(defendpoint DELETE "/:id"
"Delete a `ForeignKey`."
[id]
(write-check ForeignKey id)
(del ForeignKey :id id))
(define-routes)
......@@ -12,6 +12,7 @@
(metabase.api.meta [dataset :as dataset]
[db :as db]
[field :as field]
[fk :as fk]
[table :as table])
[metabase.middleware.auth :as auth]))
......@@ -30,6 +31,7 @@
(context "/meta/dataset" [] (+auth dataset/routes))
(context "/meta/db" [] (+auth db/routes))
(context "/meta/field" [] (+auth field/routes))
(context "/meta/fk" [] (+auth fk/routes))
(context "/meta/table" [] (+auth table/routes))
(context "/notify" [] (+apikey notify/routes))
(context "/session" [] session/routes)
......
......@@ -23,3 +23,5 @@
(assoc fk
:origin (delay (sel :one 'metabase.models.field/Field :id origin_id))
:destination (delay (sel :one 'metabase.models.field/Field :id destination_id)))))
(extend-ICanReadWrite ForeignKeyEntity :read :always, :write :superuser)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment