mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added notes about attribute serialization for tag parent and author author_id (#9932)
refs #9866 - Added notes to tag/author model attributes that are not being touched during API introduction
This commit is contained in:
parent
af12f21db7
commit
a15a45fa9b
2 changed files with 2 additions and 0 deletions
|
@ -177,6 +177,7 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) {
|
||||||
delete attrs.author_id;
|
delete attrs.author_id;
|
||||||
} else {
|
} else {
|
||||||
// CASE: we return `post.author=id` with or without requested columns.
|
// CASE: we return `post.author=id` with or without requested columns.
|
||||||
|
// @NOTE: this serialization should be moved into api layer, it's not being moved as it's not used
|
||||||
if (!options.columns || (options.columns && options.columns.indexOf('author') !== -1)) {
|
if (!options.columns || (options.columns && options.columns.indexOf('author') !== -1)) {
|
||||||
attrs.author = attrs.author_id;
|
attrs.author = attrs.author_id;
|
||||||
delete attrs.author_id;
|
delete attrs.author_id;
|
||||||
|
|
|
@ -65,6 +65,7 @@ Tag = ghostBookshelf.Model.extend({
|
||||||
var options = Tag.filterOptions(unfilteredOptions, 'toJSON'),
|
var options = Tag.filterOptions(unfilteredOptions, 'toJSON'),
|
||||||
attrs = ghostBookshelf.Model.prototype.toJSON.call(this, options);
|
attrs = ghostBookshelf.Model.prototype.toJSON.call(this, options);
|
||||||
|
|
||||||
|
// @NOTE: this serialization should be moved into api layer, it's not being moved as it's not used
|
||||||
attrs.parent = attrs.parent || attrs.parent_id;
|
attrs.parent = attrs.parent || attrs.parent_id;
|
||||||
delete attrs.parent_id;
|
delete attrs.parent_id;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue