From 496e92a51527bf53839147da3cf5b2e5b00c934d Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Mon, 15 Dec 2014 15:01:30 +0000 Subject: [PATCH] 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. --- ghost/admin/serializers/post.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghost/admin/serializers/post.js b/ghost/admin/serializers/post.js index 4b05c89e11..6a1216bde2 100644 --- a/ghost/admin/serializers/post.js +++ b/ghost/admin/serializers/post.js @@ -52,10 +52,14 @@ var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { var root = Ember.String.pluralize(type.typeKey), 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; - // Don't send HTML delete data.html; + // Inserted locally as a convenience. + delete data.author_id; + // Read-only virtual property. + delete data.url; hash[root] = [data]; }