I’m having a problem using the belongsTo relationship in my call model file. I want to have the file element in the call model point to a file and be able to access the elements present in the file model. The file element in the call model was originally only the object id for that particular file.

The call model

The file model
The issue I’m having is that I don’t know how to access the content of the file model in the call controller. I understand that call.file on line 9 in the controller is returning a promise, but I don’t know how to deal with this since I’m having to loop through individual calls. If I use something like “call.file.filename” on line 9, it returns as undefined.
The call controller file
2 posts - 2 participants
