Merge pull request #2729 from strongloop/Fix_data_argument_upsertWithWhere

Fix data argument for upsertWithWhere
This commit is contained in:
Amirali Jafarian 2016-09-07 14:19:27 -04:00 committed by GitHub
commit 73962fb3cc
2 changed files with 3 additions and 3 deletions

View File

@ -682,7 +682,7 @@ module.exports = function(registry) {
accepts: [ accepts: [
{ arg: 'where', type: 'object', http: { source: 'query' }, { arg: 'where', type: 'object', http: { source: 'query' },
description: 'Criteria to match model instances' }, description: 'Criteria to match model instances' },
{ arg: 'data', type: 'object', http: { source: 'body' }, { arg: 'data', type: 'object', model: typeName, http: { source: 'body' },
description: 'An object of model property name/value pairs' }, description: 'An object of model property name/value pairs' },
], ],
returns: { arg: 'data', type: typeName, root: true }, returns: { arg: 'data', type: typeName, root: true },

View File

@ -196,7 +196,7 @@ describe('remoting - integration', function() {
var storeClass = findClass('store'); var storeClass = findClass('store');
var methods = getFormattedMethodsExcludingRelations(storeClass.methods); var methods = getFormattedMethodsExcludingRelations(storeClass.methods);
var expectedMethods = [ var expectedMethods = [
'upsertWithWhere(where:object,data:object):store POST /stores/upsertWithWhere', 'upsertWithWhere(where:object,data:object:store):store POST /stores/upsertWithWhere',
]; ];
expect(methods).to.include.members(expectedMethods); expect(methods).to.include.members(expectedMethods);
}); });
@ -219,7 +219,7 @@ describe('With model.settings.replaceOnPUT false', function() {
'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PUT /stores-updating', 'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PUT /stores-updating',
'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PATCH /stores-updating', 'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PATCH /stores-updating',
'replaceOrCreate(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse POST /stores-updating/replaceOrCreate', 'replaceOrCreate(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse POST /stores-updating/replaceOrCreate',
'upsertWithWhere(where:object,data:object):storeWithReplaceOnPUTfalse POST /stores-updating/upsertWithWhere', 'upsertWithWhere(where:object,data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse POST /stores-updating/upsertWithWhere',
'exists(id:any):boolean GET /stores-updating/:id/exists', 'exists(id:any):boolean GET /stores-updating/:id/exists',
'exists(id:any):boolean HEAD /stores-updating/:id', 'exists(id:any):boolean HEAD /stores-updating/:id',
'findById(id:any,filter:object):storeWithReplaceOnPUTfalse GET /stores-updating/:id', 'findById(id:any,filter:object):storeWithReplaceOnPUTfalse GET /stores-updating/:id',