mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Removed tag.parent
from Admin API v2 response
refs #10438 - this is an unused field - no need to expose this field - if we start working on nested tags, this field might become interesting/used
This commit is contained in:
parent
20300cf002
commit
db148e653f
4 changed files with 22 additions and 22 deletions
|
@ -1,12 +1,8 @@
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const localUtils = require('../../../index');
|
const localUtils = require('../../../index');
|
||||||
|
|
||||||
const tag = (attrs) => {
|
const tag = (attrs, frame) => {
|
||||||
// Already deleted in model.toJSON, but leaving here so that we can clean that up when we deprecate v0.1
|
if (localUtils.isContentAPI(frame)) {
|
||||||
delete attrs.parent_id;
|
|
||||||
|
|
||||||
// Extra properties removed from v2
|
|
||||||
delete attrs.parent;
|
|
||||||
delete attrs.created_at;
|
delete attrs.created_at;
|
||||||
delete attrs.updated_at;
|
delete attrs.updated_at;
|
||||||
|
|
||||||
|
@ -20,6 +16,13 @@ const tag = (attrs) => {
|
||||||
if (attrs.description === '') {
|
if (attrs.description === '') {
|
||||||
attrs.description = null;
|
attrs.description = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
delete attrs.parent;
|
||||||
|
|
||||||
return attrs;
|
return attrs;
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,10 +21,7 @@ const mapTag = (model, frame) => {
|
||||||
const jsonModel = model.toJSON ? model.toJSON(frame.options) : model;
|
const jsonModel = model.toJSON ? model.toJSON(frame.options) : model;
|
||||||
|
|
||||||
url.forTag(model.id, jsonModel);
|
url.forTag(model.id, jsonModel);
|
||||||
|
clean.tag(jsonModel, frame);
|
||||||
if (utils.isContentAPI(frame)) {
|
|
||||||
clean.tag(jsonModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
return jsonModel;
|
return jsonModel;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,8 +35,8 @@ const expectedProperties = {
|
||||||
,
|
,
|
||||||
tag: _(schema.tags)
|
tag: _(schema.tags)
|
||||||
.keys()
|
.keys()
|
||||||
// Tag API swaps parent_id to parent
|
// unused field
|
||||||
.without('parent_id').concat('parent')
|
.without('parent_id')
|
||||||
,
|
,
|
||||||
setting: _(schema.settings)
|
setting: _(schema.settings)
|
||||||
.keys()
|
.keys()
|
||||||
|
|
|
@ -32,8 +32,8 @@ const expectedProperties = {
|
||||||
,
|
,
|
||||||
tag: _(schema.tags)
|
tag: _(schema.tags)
|
||||||
.keys()
|
.keys()
|
||||||
// Tag API swaps parent_id to parent
|
// unused field
|
||||||
.without('parent_id').concat('parent')
|
.without('parent_id')
|
||||||
,
|
,
|
||||||
setting: _(schema.settings)
|
setting: _(schema.settings)
|
||||||
.keys()
|
.keys()
|
||||||
|
|
Loading…
Add table
Reference in a new issue