mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Removed use of ?include=tags,authors,authors.roles
query param on post/page requests
no issue - Admin API v2 now includes tags and authors by default
This commit is contained in:
parent
6e5bcd68e6
commit
a0a0c50ff5
12
ghost/admin/app/adapters/page.js
Normal file
12
ghost/admin/app/adapters/page.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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) {
|
||||||
|
return this.buildURL(modelName, id, snapshot, requestType, query);
|
||||||
|
},
|
||||||
|
|
||||||
|
buildQuery(store, modelName, options) {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
});
|
12
ghost/admin/app/adapters/post.js
Normal file
12
ghost/admin/app/adapters/post.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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) {
|
||||||
|
return this.buildURL(modelName, id, snapshot, requestType, query);
|
||||||
|
},
|
||||||
|
|
||||||
|
buildQuery(store, modelName, options) {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
});
|
@ -17,8 +17,7 @@ export default AuthenticatedRoute.extend({
|
|||||||
model(params) {
|
model(params) {
|
||||||
let query = {
|
let query = {
|
||||||
id: params.post_id,
|
id: params.post_id,
|
||||||
status: 'all',
|
status: 'all'
|
||||||
formats: 'mobiledoc,plaintext'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.store.query(params.type, query)
|
return this.store.query(params.type, query)
|
||||||
|
@ -67,8 +67,6 @@ export default AuthenticatedRoute.extend({
|
|||||||
queryParams.order = params.order;
|
queryParams.order = params.order;
|
||||||
}
|
}
|
||||||
|
|
||||||
queryParams.formats = 'mobiledoc,plaintext';
|
|
||||||
|
|
||||||
let perPage = this.perPage;
|
let perPage = this.perPage;
|
||||||
let paginationSettings = assign({perPage, startingPage: 1}, paginationParams, queryParams);
|
let paginationSettings = assign({perPage, startingPage: 1}, paginationParams, queryParams);
|
||||||
|
|
||||||
|
3
ghost/admin/mirage/serializers/page.js
Normal file
3
ghost/admin/mirage/serializers/page.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import PostSerializer from './post';
|
||||||
|
|
||||||
|
export default PostSerializer.extend({});
|
@ -3,16 +3,11 @@ import BaseSerializer from './application';
|
|||||||
export default BaseSerializer.extend({
|
export default BaseSerializer.extend({
|
||||||
embed: true,
|
embed: true,
|
||||||
|
|
||||||
include(request) {
|
include(/*request*/) {
|
||||||
let includes = [];
|
let includes = [];
|
||||||
|
|
||||||
if (request.queryParams.include && request.queryParams.include.indexOf('tags') >= 0) {
|
|
||||||
includes.push('tags');
|
includes.push('tags');
|
||||||
}
|
|
||||||
|
|
||||||
if (request.queryParams.include && request.queryParams.include.indexOf('authors') >= 0) {
|
|
||||||
includes.push('authors');
|
includes.push('authors');
|
||||||
}
|
|
||||||
|
|
||||||
return includes;
|
return includes;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user