Thanks, @vince! Definitely getting closer. I was able to trigger the callback and be able to select the current record so we’re no longer losing that signal. The issue though is that we still need to reload the whole promise for that currently selected record; which has many nested promises from DS.PromiseArray
.
From doing some googling, it looks like I should conceptually be able to update the record that was updated from the action doing something like this:
this.store.findRecord('forest-TalentQueuexUser', refetchUser.id).then(newTalentQueuexUser => {
return newTalentQueuexUser;
});
But even if this is possible, I’d still need to move the details for that record into an object that’s getting returned by the current record promise. I’m sure that sounds confusing without being able to see the entire structure of the component!
If it helps, I essentially have a large promise that gathers up 2 people lists and combines them into a normalized list. I then take that list, parse it based on some booleans like hasUser
, and then divide it into lanes based on who is missing a user or other similar data. When an Action is triggered, it will change the data and thus the lane it belongs to. So (and sorry for the long-winded explanation) I’m trying to avoid having to re-fetch all the data for 1 record update, while also updating the normalized list that the updated record is in.
The promise looks like this:
// fetch all non-users and users
return DS.PromiseArray.create({
promise: this.loadNonUsersAndUsers(nonParams, userParams)
.then(([
nonUsers, users
]) => {
// merge nonUsers and users as standardized talent
const talent = [];
nonUsers.map(nonUser => {
talent.push({ firstName, hasUser, etc});
});
users.map(user => {
talent.push({ firstName, hasUser, etc});
});
// place talent into their respective lanes
this.currentRecord.lanes = [
{
key: 'missingUser',
talent: talent.filter(talent => !talent.hasUser),
}
Not sure if there is any way of injecting the updated data into this talent
object, but that’s is ultimately what I’m trying to accomplish after the action is taken.
Thanks, @vince for your help and reading through.