I am running into an issue where I would like to modify the objects inside an array based on data returned from a subscription.
this.options = this.options.map(data => {
this.workflowTemplateService.getWorkflowTemplateStatistics(data.id).subscribe(res => {
const available = (res.contactsInProgress + res.contactsInWaitingRoom + res.pausedCount).toString();
const waitingRoomLimit = res.waitingRoomLimit;
const quota = available.toString() + '/' + waitingRoomLimit.toString();
console.log("Hit quota: ", quota);
return {...data, quota};
});
});
I wanted to do something like this where I would be able to add the quota property to each of the objects inside the array but I am getting an error related to returning void. I was wondering if there were another way where I would able to modify the options such that I can add the quota property into the options array.