Ghost/ghost/admin/app/routes/designsandbox.js

19 lines
486 B
JavaScript
Raw Normal View History

2021-02-05 15:48:38 +03:00
import Route from '@ember/routing/route';
import {inject as service} from '@ember/service';
export default class DesignsandboxRoute extends Route {
@service config;
@service store;
2021-02-05 15:48:38 +03:00
beforeModel() {
super.beforeModel(...arguments);
if (!this.config.get('enableDeveloperExperiments')) {
2021-02-05 15:48:38 +03:00
return this.transitionTo('home');
}
}
model() {
return this.store.queryRecord('post', {limit: 1, order: 'published_at DESC'});
}
}