Skip to content

Commit

Permalink
Add an /api/collections/trash endpoint (#42476)
Browse files Browse the repository at this point in the history
This fetches the Trash in exactly the same way as if we'd fetched it
with `/api/collection/:id` with the Trash ID. I hadn't realized that the
frontend was doing this with the previously hardcoded Trash ID.
  • Loading branch information
johnswanson committed May 10, 2024
1 parent 73088d1 commit e3a8a22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/metabase/api/collection.clj
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,12 @@
{id ms/PositiveInt}
(collection-detail (api/read-check Collection id)))

(api/defendpoint GET "/trash"
"Fetch the trash collection, as in `/api/collection/:trash-id`"
[]
{}
(collection-detail (api/read-check (collection/trash-collection))))

(api/defendpoint GET "/root/timelines"
"Fetch the root Collection's timelines."
[include archived]
Expand Down

0 comments on commit e3a8a22

Please sign in to comment.