From a3a0b8d6b9054cb1834b90cb1474c71b05b0ca18 Mon Sep 17 00:00:00 2001 From: roccotripaldi Date: Sun, 29 Oct 2017 14:27:58 -0400 Subject: [PATCH] Post Editor: adds autosave parameter to outbound queries When the post editor decides to save automatically, add an autosave parameter to the API query. This allows the server to differentiate between autosaves, and manual saves. --- client/lib/posts/actions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/lib/posts/actions.js b/client/lib/posts/actions.js index 0b78037dbf0dc..8f5c862a51995 100644 --- a/client/lib/posts/actions.js +++ b/client/lib/posts/actions.js @@ -211,7 +211,7 @@ PostActions = { } ); } else { - PostActions.saveEdited( null, null, callback, { recordSaveEvent: false } ); + PostActions.saveEdited( null, null, callback, { recordSaveEvent: false, autosave: true } ); } }, @@ -347,6 +347,9 @@ PostActions = { context: 'edit', apiVersion: '1.2', }; + if ( options && options.autosave ) { + query.autosave = options.autosave; + } if ( ! options || options.recordSaveEvent !== false ) { recordSaveEvent( context ); // do this before changing status from 'future'