Closed rvmourik closed 4 years ago
Shorthands don't work for nested resources, only top-level, so for this one I would just write it out.
Something like:
this.get('/messages/:id/comments', (schema, request) => {
return schema.messages.find(request.params.id).comments
})
should do the trick!
Thanks for the quick reply and solution @samselikoff
Hi there,
Started using MirageJS in one of our Vue projects, but I am having problems with setting up routes to related resources.
I have a message and comments model, with a belongsTo and hasMany, the data is there and with
alwaysIncludeLinkageData: true
I see the data in the response.These routes work just fine, but the one below:
Does not work.
How do I achieve this set-up?
Thanks in advance