mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
7658cd2ee8
closes #2883, closes #2951 - introduce custom findQuery in ApplicationAdapter - posts/post route and editor/edit route now use custom findQuery to find a single post by id with query params - create a sorting function in PostsController for out-of-order loading - refresh updated posts in posts.index to make PostsList highlight latest draft after returning from a save in editor
19 lines
508 B
JavaScript
19 lines
508 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
|
|
var PostsIndexRoute = AuthenticatedRoute.extend({
|
|
// 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;
|