You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want this to create the contact if it doesn't exist, and fetch and use a contact if the contact ID is passed. But what feathers is doing is only running the query to create the customer without the contact.
currently that does not work with feathers-sequelize. But you can use an after hook to handle this after creating the customer. The actual "findOrCreate" logic you want to have is not there as well. Therefore you either do it yourself via 2 api calls or you write your own service which itself is directly using the sequelize model in its own create method. But tbh i would just first query, then create and with the after hook create the customer.
If I want to create multiple models in one go, can I do so?
For example, I have a
Customer
that has aContact
associated with it.I run sequelize's associations while importing the models, like so
Finally, I have the customer service defined like this
Now, the problem that I am stuck on is creating a contact along with the customer in one go.
For example,
I want this to create the contact if it doesn't exist, and fetch and use a contact if the contact ID is passed. But what feathers is doing is only running the query to create the customer without the contact.
This is what I see in the logs.
Please advise on the best way to approach this problem.
The text was updated successfully, but these errors were encountered: