I don’t know what the models are on your side but these lines look like a problem:
if data.model_id
data.model = App.Model.findNative(data.model_id)
console.log data.model
if data.seller_id
data.seller = App.Model.findNative(data.seller_id)
console.log data.seller
It must be like App.Seller.find
. Also App.Model
is a blocked namespace, I think. You need to rename it to App.AssetModel
or something so you don’t issues.
Also if you want your data ready for your fillup function you need to serve them in your assets. Many models have dedicated asset files on the backend side see some examples here:
- zammad/app/models/organization.rb at ce363b965b135dc22a569cb6da80661625267761 · zammad/zammad · GitHub
- zammad/app/models/organization/assets.rb at ce363b965b135dc22a569cb6da80661625267761 · zammad/zammad · GitHub
You will need something similar for your Asset model so that you can auto load the seller and the “model” with it.