Not getting relationship or child object inside the parent object in response. #2669
Vishwas-verma
started this conversation in
General
Replies: 1 comment 1 reply
-
Try @hasMany(() => Todo, {
foreignKey: 'created_by',
})
public todos: HasMany<typeof Todo> const userQuery = User.query().preload('todos'); Some overall feedback:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want my User model to include Todo model but I am not getting it inside user model.
Here is my-
User model
Todo Model
Here is my controller code:
Request-Response
Why I am not getting todos inside user object in response.
Beta Was this translation helpful? Give feedback.
All reactions