You'll want to do something like this!
const arr = Object.values(query16.data[0])
const query = your_api_query_here
const promises = arr.map((item) => {
return query.trigger({
additionalScope: {
assignment_id: item
}
});
});
return Promise.all(promises)
To explain line 1, it looks like your query16.data is an array of an object like this:
[{0: "336a...", 1: "1edc..."}]
And we want to re-format this to be an array of ids, so we can do:
Object.values(query16.data[0])
to grab the array. Then, we want to trigger your REST API query for each of these ids in your array!
Let me know how this works for you