Bug or question
mirage is giving string as response when we tried to return array in endpoint and it returns as object when we tried to return only one object from array:
Illustration:
I have below endpoints:
this.get('/users/:id',function(schema,request){ return schema.users.findBy({id:request.params.id}) }
this.get('/users',function(schema,request){ return schema.users.all() }
In test environment, both are working fine whereas in dev environment, second endpoint is giving response in string instead of an array.
Bug or question
mirage is giving string as response when we tried to return array in endpoint and it returns as object when we tried to return only one object from array:
Illustration:
I have below endpoints:
this.get('/users/:id',function(schema,request){ return schema.users.findBy({id:request.params.id}) }this.get('/users',function(schema,request){ return schema.users.all() }In test environment, both are working fine whereas in dev environment, second endpoint is giving response in string instead of an array.