mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
0caa539330
refs https://github.com/TryGhost/Team/issues/581 requires https://github.com/TryGhost/Ghost/pull/12932 - added segment option and select to default newsletter recipients setting - updated segment selector to fetch labels/products and show as options - updated segment selector and count component to call an action when count changes so we can use it in the email confirmation modal - removed usage and mapping of older `'none'`, `'all'`, `'free'`, and `'paid'` email recipient filter values
26 lines
905 B
JavaScript
26 lines
905 B
JavaScript
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
|
|
|
export default ApplicationAdapter.extend({
|
|
// posts and pages now include everything by default
|
|
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
|
|
let url = this.buildURL(modelName, id, snapshot, requestType, query);
|
|
let parsedUrl = new URL(url);
|
|
|
|
if (snapshot && snapshot.adapterOptions && snapshot.adapterOptions.sendEmailWhenPublished) {
|
|
let emailRecipientFilter = snapshot.adapterOptions.sendEmailWhenPublished;
|
|
|
|
if (emailRecipientFilter === 'status:free,status:-free') {
|
|
emailRecipientFilter = 'all';
|
|
}
|
|
|
|
parsedUrl.searchParams.append('email_recipient_filter', emailRecipientFilter);
|
|
}
|
|
|
|
return parsedUrl.toString();
|
|
},
|
|
|
|
buildQuery(store, modelName, options) {
|
|
return options;
|
|
}
|
|
});
|