How can i check available related models on relation type "referencesMany" ?
In case i want to create a Book which belong to categories, so i must create relation on Book model like this:
"relations": {
"categories": {
"type": "referencesMany",
"model": "Category"
}
}
But when i create a Book i want to check categories info of Book are available on Category model, how can i do it ? please help me, thanks
You should be able to set up beforeCreate hook for the Book model so that you can do the check of categories.
Hi @bluestaralone,
Does Raymond's answer solve your problem? If no please share a sample repo using our loopback-sandbox so we can comment on your code; also we encourage you to ask your question in our Google community so people can answer your question easily.
Thanks
I will be closing this issue due to inactivity; please feel free to re-open it if you run into the same issue and we can look into it further.
Thanks!