datalab-org / datalab

datalab is a place to store experimental data and the connections between them.
https://docs.datalab-org.io
MIT License
42 stars 17 forks source link

Add functionality to `/collections` route to receive and add a list of items to a collection #819

Closed ml-evs closed 3 days ago

ml-evs commented 1 month ago

Right now, we have a PATCH route for /collections that updates the metadata of a given collection.

We should add a streamlined way of adding a list of items to a collection. This could be a new route:

POST /collections/<collection_id>
{"data": {"refcodes": ["ABCDEF", "GHIJKL"]}}

or we extend the current

PATCH /collections/<collection_id>
{"data": {"collection_id": "blah", ... "refcodes": ["ABCDEF"]}}

I think I prefer the first one.

This can then be used in the sample table -> selected items -> add to collection button.