mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
de93c691cd
refs https://github.com/TryGhost/Team/issues/1277 - added `member` query param that expects a member ID - using an ID as it makes the filtering simpler than using an email because there is no async member fetching required - updated `filter` generation to build `type` and `member` parts and combine them in an AND query - updated link in member screen to use a `member` param rather than a `filter` param - resets any `excludedEvents` param so all events for the member will be shown when following link from member->members-activity
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
import {helper} from '@ember/component/helper';
|
|
|
|
export const DEFAULT_QUERY_PARAMS = {
|
|
posts: {
|
|
type: null,
|
|
visibility: null,
|
|
author: null,
|
|
tag: null,
|
|
order: null
|
|
},
|
|
pages: {
|
|
type: null,
|
|
visibility: null,
|
|
author: null,
|
|
tag: null,
|
|
order: null
|
|
},
|
|
'members.index': {
|
|
label: null,
|
|
paid: null,
|
|
search: null,
|
|
filter: null,
|
|
order: null
|
|
},
|
|
'members-activity': {
|
|
excludedEvents: null,
|
|
member: null
|
|
}
|
|
};
|
|
|
|
// in order to reset query params to their defaults when using <LinkTo> or
|
|
// `transitionTo` it's necessary to explicitly set each param. This helper makes
|
|
// it easier to provide a "resetting" link, especially when used with custom views
|
|
|
|
export function resetQueryParams(routeName, newParams) {
|
|
return Object.assign({}, DEFAULT_QUERY_PARAMS[routeName], newParams);
|
|
}
|
|
|
|
export default helper(function (params/*, hash*/) {
|
|
return resetQueryParams(...params);
|
|
});
|