Calling http://localhost:3030/api/seq/events?include=Assessment or http://localhost:3030/api/seq/events?include=Organisation produces the response, including the associated entity. But http://localhost:3030/api/seq/events?include=[Assessment,Organisation] includes none of the associated entities.
I have the following associations defined:
``` javascript
module.exports = ({
Assessment, Event, Organisation
}) => {
Event.hasMany(Assessment, {foreignKey:'eventId'});
Event.belongsTo(Organisation, {foreignKey:'organisationId'});
}
```
Calling `http://localhost:3030/api/seq/events?include=Assessment` or `http://localhost:3030/api/seq/events?include=Organisation` produces the response, including the associated entity. But `http://localhost:3030/api/seq/events?include=[Assessment,Organisation]` includes none of the associated entities.
One more question. If I had nested associations, e.g. Event hasMany Assessments hasMany Questions, how would the GET request parameters look?
Perfect! That works, thanks.
One more question. If I had nested associations, e.g. `Event` hasMany `Assessments` hasMany `Questions`, how would the GET request parameters look?
Uhm, I had a look at the code, and don't think I'll be able to get this done ... Will leave it as a feature request for you, whenever you get the time.
Thanks for sorting out the other issues so quickly!
Uhm, I had a look at the code, and don't think I'll be able to get this done ... Will leave it as a feature request for you, whenever you get the time.
Thanks for sorting out the other issues so quickly!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I have the following associations defined:
Calling
http://localhost:3030/api/seq/events?include=Assessmentorhttp://localhost:3030/api/seq/events?include=Organisationproduces the response, including the associated entity. Buthttp://localhost:3030/api/seq/events?include=[Assessment,Organisation]includes none of the associated entities.The standard way to represent arrays in HTTP GET parameters is
include[]=Assessment&include[]=Organisation, may you try that?Perfect! That works, thanks.
One more question. If I had nested associations, e.g.
EventhasManyAssessmentshasManyQuestions, how would the GET request parameters look?Great!
Um, nested associations are not supported at the moment. You can create a pull-request if you want.
Uhm, I had a look at the code, and don't think I'll be able to get this done ... Will leave it as a feature request for you, whenever you get the time.
Thanks for sorting out the other issues so quickly!
Alright, that's fine. Thank you for reporting and following up with the issues.