Add index element route

This commit is contained in:
Stanislav Romanov 2022-03-21 11:25:59 +03:00
parent 5ea856dc41
commit 0cf17ddbc3
3 changed files with 11 additions and 2 deletions

View file

@ -7,7 +7,7 @@ export default class Router extends EmberRouter {
}
Router.map(function () {
this.route('indexes', function() {
this.route('indexes', function () {
this.route('element', { path: '/:index_id' });
});
});

View file

@ -1,7 +1,10 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class IndexesRoute extends Route {
model() {
@service store;
async model() {
return this.store.findAll('index');
}
}

View file

@ -1,4 +1,10 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class IndexesElementRoute extends Route {
@service store;
async model({ index_id }) {
return this.store.find('index', index_id);
}
}