0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Removed more unused fields from Admin API v2 response

refs #10438

- these fields are not used
- no need to expose them in v2
- we will either remove them in the next major or use them for new features (will see)
This commit is contained in:
kirrg001 2019-02-13 11:41:14 +01:00
parent a3e7a7b3ea
commit f8b62a063b
3 changed files with 17 additions and 7 deletions

View file

@ -21,7 +21,7 @@ const tag = (attrs, frame) => {
// Already deleted in model.toJSON, but leaving here so that we can clean that up when we deprecate v0.1
delete attrs.parent_id;
// Extra properties removed from v2
// @NOTE: unused fields
delete attrs.parent;
return attrs;
@ -36,10 +36,7 @@ const author = (attrs, frame) => {
delete attrs.status;
// Extra properties removed from v2
delete attrs.accessibility;
delete attrs.locale;
delete attrs.tour;
delete attrs.visibility;
// We are standardising on returning null from the Content API for any empty values
if (attrs.twitter === '') {
@ -65,6 +62,10 @@ const author = (attrs, frame) => {
}
}
// @NOTE: unused fields
delete attrs.visibility;
delete attrs.accessibility;
delete attrs.locale;
delete attrs.ghost_auth_id;
return attrs;
@ -72,12 +73,9 @@ const author = (attrs, frame) => {
const post = (attrs, frame) => {
if (localUtils.isContentAPI(frame)) {
delete attrs.locale;
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// delete attrs.page;
delete attrs.status;
delete attrs.visibility;
// We are standardising on returning null from the Content API for any empty values
if (attrs.twitter_title === '') {
@ -100,6 +98,8 @@ const post = (attrs, frame) => {
}
}
delete attrs.locale;
delete attrs.visibility;
delete attrs.author;
return attrs;

View file

@ -25,12 +25,17 @@ const expectedProperties = {
.keys()
// by default we only return html
.without('mobiledoc', 'plaintext')
.without('visibility')
.without('locale')
// always returns computed properties: url, comment_id, primary_tag, primary_author
.without('author_id').concat('url', 'primary_tag', 'primary_author')
,
user: _(schema.users)
.keys()
.without('visibility')
.without('password')
.without('accessibility')
.without('locale')
.without('ghost_auth_access_token')
.without('ghost_auth_id')
,

View file

@ -22,12 +22,17 @@ const expectedProperties = {
.keys()
// by default we only return html
.without('mobiledoc', 'plaintext')
.without('visibility')
.without('locale')
// always returns computed properties: url, comment_id, primary_tag, primary_author
.without('author_id').concat('url', 'primary_tag', 'primary_author')
,
user: _(schema.users)
.keys()
.without('visibility')
.without('password')
.without('accessibility')
.without('locale')
.without('ghost_auth_access_token')
.without('ghost_auth_id')
,