Skip to content
Snippets Groups Projects
Unverified Commit 894cbe4d authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Merge pull request #6476 from metabase/fix-bad-error-message-in-card-endpoint

Fix incorrect error message for GET /api/card endpoint
parents ec12d4c3 cf8c1485
No related branches found
No related tags found
No related merge requests found
......@@ -127,17 +127,20 @@ Delete a `Card`.
## `GET /api/card/`
Get all the `Cards`. Option filter param `f` can be used to change the set of Cards that are returned; default is `all`,
but other options include `mine`, `fav`, `database`, `table`, `recent`, `popular`, and `archived`. See corresponding implementation
functions above for the specific behavior of each filter option. :card_index:
Get all the `Cards`. Option filter param `f` can be used to change the set of Cards that are returned; default is
`all`, but other options include `mine`, `fav`, `database`, `table`, `recent`, `popular`, and `archived`. See
corresponding implementation functions above for the specific behavior of each filter option. :card_index:
Optionally filter cards by LABEL or COLLECTION slug. (COLLECTION can be a blank string, to signify cards with *no collection* should be returned.)
Optionally filter cards by LABEL or COLLECTION slug. (COLLECTION can be a blank string, to signify cards with *no
collection* should be returned.)
NOTES:
NOTES:
* Filtering by LABEL is considered *deprecated*, as `Labels` will be removed from an upcoming version of Metabase in favor of `Collections`.
* LABEL and COLLECTION params are mutually exclusive; if both are specified, LABEL will be ignored and Cards will only be filtered by their `Collection`.
* If no `Collection` exists with the slug COLLECTION, this endpoint will return a 404.
* Filtering by LABEL is considered *deprecated*, as `Labels` will be removed from an upcoming version of Metabase
in favor of `Collections`.
* LABEL and COLLECTION params are mutually exclusive; if both are specified, LABEL will be ignored and Cards will
only be filtered by their `Collection`.
* If no `Collection` exists with the slug COLLECTION, this endpoint will return a 404.
##### PARAMS:
......@@ -161,7 +164,8 @@ Get `Card` with ID.
## `GET /api/card/embeddable`
Fetch a list of Cards where `enable_embedding` is `true`. The cards can be embedded using the embedding endpoints and a signed JWT.
Fetch a list of Cards where `enable_embedding` is `true`. The cards can be embedded using the embedding endpoints
and a signed JWT.
You must be a superuser to do this.
......@@ -219,9 +223,9 @@ Update the set of `Labels` that apply to a `Card`.
## `POST /api/card/:card-id/public_link`
Generate publically-accessible links for this Card. Returns UUID to be used in public links.
(If this Card has already been shared, it will return the existing public link rather than creating a new one.)
Public sharing must be enabled.
Generate publically-accessible links for this Card. Returns UUID to be used in public links. (If this Card has
already been shared, it will return the existing public link rather than creating a new one.) Public sharing must
be enabled.
You must be a superuser to do this.
......@@ -245,7 +249,8 @@ Run the query associated with a Card.
## `POST /api/card/:card-id/query/:export-format`
Run the query associated with a Card, and return its results as a file in the specified format. Note that this expects the parameters as serialized JSON in the 'parameters' parameter
Run the query associated with a Card, and return its results as a file in the specified format. Note that this
expects the parameters as serialized JSON in the 'parameters' parameter
##### PARAMS:
......@@ -258,8 +263,8 @@ Run the query associated with a Card, and return its results as a file in the sp
## `POST /api/card/collections`
Bulk update endpoint for Card Collections. Move a set of `Cards` with CARD_IDS into a `Collection` with COLLECTION_ID,
or remove them from any Collections by passing a `null` COLLECTION_ID.
Bulk update endpoint for Card Collections. Move a set of `Cards` with CARD_IDS into a `Collection` with
COLLECTION_ID, or remove them from any Collections by passing a `null` COLLECTION_ID.
##### PARAMS:
......
This diff is collapsed.
......@@ -101,8 +101,8 @@
(expect (get middleware/response-unauthentic :body) (http/client :put 401 "card/13"))
;; Make sure `id` is required when `f` is :database
(expect {:errors {:id "id is required parameter when filter mode is 'database'"}}
;; Make sure `model_id` is required when `f` is :database
(expect {:errors {:model_id "model_id is a required parameter when filter mode is 'database'"}}
((user->client :crowberto) :get 400 "card" :f :database))
;; Filter cards by table
......@@ -124,8 +124,8 @@
(card-returned? table-2-id card-1-id)
(card-returned? table-2-id card-2-id)]))
;; Make sure `id` is required when `f` is :table
(expect {:errors {:id "id is required parameter when filter mode is 'table'"}}
;; Make sure `model_id` is required when `f` is :table
(expect {:errors {:model_id "model_id is a required parameter when filter mode is 'table'"}}
((user->client :crowberto) :get 400 "card", :f :table))
......
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