mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Fixed post/page API requests having incorrect ?include=
params
refs 58b0a1b90d
- `buildQuery` in the post/page adapters was recently removed which meant it was falling back to the `EmbeddedRelationAdapter.buildQuery` method which uses the defined Ember Data relationships to build up an `?include=` param
- the Ember Data relationships are not fully in sync with the API because we don't have models for all of the members/tiers related relationships meaning we were adding a more restrictive `?include` parameter than what the API would use internally by default, breaking parts of the app that expected the default embedded relationships
This commit is contained in:
parent
9972892259
commit
ce461aef34
@ -22,4 +22,11 @@ export default class Page extends ApplicationAdapter {
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
// posts and pages now include all relations by default so we don't want
|
||||
// EmbeddedRelationAdapter.buildQuery adding an `?include=` param that
|
||||
// overrides the defaults with a more restrictive list
|
||||
buildQuery(store, modelName, options) {
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
|
||||
export default class Post extends ApplicationAdapter {
|
||||
// posts and pages now include everything by default
|
||||
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
|
||||
const url = this.buildURL(modelName, id, snapshot, requestType, query);
|
||||
const parsedUrl = new URL(url);
|
||||
@ -40,4 +39,11 @@ export default class Post extends ApplicationAdapter {
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
// posts and pages now include all relations by default so we don't want
|
||||
// EmbeddedRelationAdapter.buildQuery adding an `?include=` param that
|
||||
// overrides the defaults with a more restrictive list
|
||||
buildQuery(store, modelName, options) {
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user