Новичок в ember, я пытаюсь смоделировать сервер API, используя ember-cli-mirage. Я создаю запрос от account.js
до store
, но ответ не тот, который я ожидаю.
## /app/routes/account.js
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default Route.extend({
store: service(),
model() {
this.store.findAll('accounts').then(response => {
console.log(response)
});
// return this.store.findAll('accounts');
}
});
## /app/mirage/config.js
export default function () {
this.get('/accounts', (schema) => {
return {
data: [
{
firstName: 'John'
}
]
};
}, {timing: 2000});
}
Это ответ, который я получаю,
![enter image description here](https://i.stack.imgur.com/MwiAQ.png)
Чего-то не хватает?