Add index element route
This commit is contained in:
parent
5ea856dc41
commit
0cf17ddbc3
3 changed files with 11 additions and 2 deletions
|
|
@ -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' });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue