added explicitSinceSource as model option and only set source to query if option set to true
This commit is contained in:
parent
01f41614dd
commit
4ea8c29bd2
|
@ -893,18 +893,24 @@ 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: [
|
||||
{ arg: 'since', type: 'number', description: 'Find deltas since this checkpoint',
|
||||
http: { source: 'form' }},
|
||||
{arg: 'since', type: 'number', description: 'Find deltas since this checkpoint'},
|
||||
{arg: 'remoteChanges', type: 'array', description: 'an array of change objects',
|
||||
http: { source: 'form' }}
|
||||
http: {source: 'body'}},
|
||||
],
|
||||
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[0].accepts.http = {source: 'query'};
|
||||
}
|
||||
setRemoting(PersistedModel, 'diff', diffOptions);
|
||||
|
||||
setRemoting(PersistedModel, 'changes', {
|
||||
description: 'Get the changes to a model since a given checkpoint.' +
|
||||
|
|
Loading…
Reference in New Issue