This commit is contained in:
Jordan Thomas 2017-05-23 17:47:39 +00:00 committed by GitHub
commit 127f22716d
1 changed files with 9 additions and 2 deletions

View File

@ -898,7 +898,7 @@ module.exports = function(registry) {
}
if (options.trackChanges || options.enableRemoteReplication) {
setRemoting(PersistedModel, 'diff', {
var diffOptions = {
description: 'Get a set of deltas and conflicts since the given checkpoint.',
accessType: 'READ',
accepts: [
@ -908,7 +908,14 @@ module.exports = function(registry) {
],
returns: {arg: 'result', type: 'object', root: true},
http: {verb: 'post', path: '/diff'},
});
};
// The since argument is not passed in remote requests
// set options.explicitSinceSource to true in model config
// to explicitly set argument source and ensure its passed
if (options.explicitSinceSource) {
diffOptions.accepts[0].http = {source: 'query'};
}
setRemoting(PersistedModel, 'diff', diffOptions);
setRemoting(PersistedModel, 'changes', {
description: 'Get the changes to a model since a given checkpoint.' +