mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Do not include url and author_id in post payload.
No Issue. - Neither of these properties should be included in the payload sent from the client to the API. URL is a read-only virtual property, and author_id is inserted locally as a convenience.
This commit is contained in:
parent
5ac4bf1c3c
commit
496e92a515
@ -52,10 +52,14 @@ var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
|
|||||||
var root = Ember.String.pluralize(type.typeKey),
|
var root = Ember.String.pluralize(type.typeKey),
|
||||||
data = this.serialize(record, options);
|
data = this.serialize(record, options);
|
||||||
|
|
||||||
// Don't ever pass uuid's
|
// Properties that exist on the model but we don't want sent in the payload
|
||||||
|
|
||||||
delete data.uuid;
|
delete data.uuid;
|
||||||
// Don't send HTML
|
|
||||||
delete data.html;
|
delete data.html;
|
||||||
|
// Inserted locally as a convenience.
|
||||||
|
delete data.author_id;
|
||||||
|
// Read-only virtual property.
|
||||||
|
delete data.url;
|
||||||
|
|
||||||
hash[root] = [data];
|
hash[root] = [data];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user