Skip to content
Snippets Groups Projects
Unverified Commit 6ead5155 authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Add collection ID to `/collection/:id/items` (#41757)

Pretty much does what it says on the tin.
parent c4134211
No related branches found
No related tags found
No related merge requests found
...@@ -635,6 +635,7 @@ ...@@ -635,6 +635,7 @@
`post-process-collection-children`. Must respect the order passed in." `post-process-collection-children`. Must respect the order passed in."
[collection rows] [collection rows]
(->> (map-indexed (fn [i row] (vary-meta row assoc ::index i)) rows) ;; keep db sort order (->> (map-indexed (fn [i row] (vary-meta row assoc ::index i)) rows) ;; keep db sort order
(map #(assoc % :collection_id (:id collection)))
(map remove-unwanted-keys) (map remove-unwanted-keys)
(group-by :model) (group-by :model)
(into [] (into []
......
...@@ -647,7 +647,8 @@ ...@@ -647,7 +647,8 @@
:moderator_id user-id :moderator_id user-id
:most_recent true}] :most_recent true}]
(is (= (mt/obj->json->obj (is (= (mt/obj->json->obj
[{:id card-id [{:collection_id (:id collection)
:id card-id
:location nil :location nil
:name (:name card) :name (:name card)
:collection_position nil :collection_position nil
......
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