mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
no issue - returns the promise/result from `loadNextPage` so that it's return value can be utilised in closure actions - sets the `isLoading` property in `loadFirstPage` to match `loadNextPage` behaviour - reset the `isLoading` property even if the request fails - adds a `didReceivePaginationMeta` hook so that consumers of the mixin can use the metadata values without having to rely on observers - eg. pulling the `total` into a separate property that can be manipulated when items are added/removed but still reset to the sever's total value the next time a page is loaded - renames the `pagination-route` mixin to simply `pagination` as it's not tied to routes and works equally well in other objects that need to paginate an API resource
32 lines
825 B
JavaScript
32 lines
825 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
import PaginationMixin from 'ghost/mixins/pagination';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, PaginationMixin, {
|
|
titleToken: 'Team',
|
|
|
|
classNames: ['view-team'],
|
|
|
|
paginationModel: 'user',
|
|
paginationSettings: {
|
|
status: 'active',
|
|
limit: 20
|
|
},
|
|
|
|
model() {
|
|
this.loadFirstPage();
|
|
|
|
return this.store.query('user', {limit: 'all', status: 'invited'}).then(() => {
|
|
return this.store.filter('user', () => {
|
|
return true;
|
|
});
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
reload() {
|
|
this.refresh();
|
|
}
|
|
}
|
|
});
|