mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
93632349b9
refs https://github.com/TryGhost/Team/issues/1571 - When creating a new newsletter, the counts were not loaded - When updating a newsletter, the counts were not updated - Requires https://github.com/TryGhost/Ghost/pull/14696
19 lines
654 B
JavaScript
19 lines
654 B
JavaScript
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
|
|
|
export default class Newsletter extends ApplicationAdapter {
|
|
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
|
|
const url = this.buildURL(modelName, id, snapshot, requestType, query);
|
|
const parsedUrl = new URL(url);
|
|
|
|
if (snapshot?.adapterOptions?.optInExisting) {
|
|
parsedUrl.searchParams.append('opt_in_existing', 'true');
|
|
}
|
|
|
|
if (snapshot?.adapterOptions?.include) {
|
|
parsedUrl.searchParams.append('include', snapshot?.adapterOptions?.include);
|
|
}
|
|
|
|
return parsedUrl.toString();
|
|
}
|
|
}
|