@stevehorne wrote:
I have two model types,
User
andGroup
. User has a hasMany relationship to Group (calledgroups
).When returning a
User
, the backend has a relationship to groups that is somewhat broken: Rather than returning IDs for the groups, it returns name (a property on theGroup
model).Changing the backend is out of scope at this point, so I need to fix the relationship in my serializer. The problem is that
normalizeResponse
must return a valid document, it can't defer with a promise to resolve. In order to map the group name to get the group ID, I would have to make an asynchronous request.Does anyone have a suggestion about how I can accomplish this with the least amount of friction?
Posts: 1
Participants: 1