0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/routes/posts/index.js

20 lines
589 B
JavaScript
Raw Normal View History

import AuthenticatedRoute from 'ghost/routes/authenticated';
import loadingIndicator from 'ghost/mixins/loading-indicator';
var PostsIndexRoute = AuthenticatedRoute.extend(loadingIndicator, {
// redirect to first post subroute
beforeModel: function () {
var self = this;
return this.store.find('post', {
status: 'all',
staticPages: 'all'
}).then(function (records) {
var post = records.get('firstObject');
return self.transitionTo('posts.post', post);
});
}
});
export default PostsIndexRoute;