I have this data model:
Shareholder: 1--N :ShareholderDocument: 1--1 :Document
ShareholderDocument only contains an
documentId, while Document model has more information like contentType, documentType, status etc.
In my view Shareholder, I would to see its list of documents with all the infos (contentType, documentType, status etc).
I created in my sequelize ShareholderDocumentModel a hook
afterFind to retrieve these fields:
When I go to my dashboard, on a Shareholder, I see the following:
You can see on the bottom right that all fields related to Document are blank (contentType, documentType, status etc). I guess this is due to this issue from Sequelize
I am expecting to see all fields filled like this (caught from the ShareholderDocument view, where all fields are correctly fetched -given its not fetched using a relationship (cf issue mentionned above)-)
The environnement is local
I understand given the issue mntionned above, what I want to do using sequelize hooks might be impossible.
My question instead would be:
- Should I use Forest Hooks ?
- Should I use smartFields ?
- Should I use a smartRelationship with DocumentModel directly ? (we would like to avoid it)
Thank you for your help