From 4d6f2da5785908ac34d481a680caf5008563e752 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Wed, 7 Sep 2016 13:23:53 -0400 Subject: [PATCH] Fix data argument for upsertWithWhere * Related PR: #2727 --- lib/persisted-model.js | 2 +- test/remoting.integration.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/persisted-model.js b/lib/persisted-model.js index e2b1968d..3e4530e6 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -682,7 +682,7 @@ module.exports = function(registry) { accepts: [ { arg: 'where', type: 'object', http: { source: 'query' }, 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' }, ], returns: { arg: 'data', type: typeName, root: true }, diff --git a/test/remoting.integration.js b/test/remoting.integration.js index 5d1dbc72..41ec366e 100644 --- a/test/remoting.integration.js +++ b/test/remoting.integration.js @@ -196,7 +196,7 @@ describe('remoting - integration', function() { var storeClass = findClass('store'); var methods = getFormattedMethodsExcludingRelations(storeClass.methods); 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); }); @@ -219,7 +219,7 @@ describe('With model.settings.replaceOnPUT false', function() { 'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PUT /stores-updating', 'upsert(data:object:storeWithReplaceOnPUTfalse):storeWithReplaceOnPUTfalse PATCH /stores-updating', '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 HEAD /stores-updating/:id', 'findById(id:any,filter:object):storeWithReplaceOnPUTfalse GET /stores-updating/:id',