Make sure 'upsert' is used as the remote operation name
See https://github.com/strongloop/loopback/issues/359
This commit is contained in:
parent
8a7e5806a3
commit
f7afade229
|
@ -222,7 +222,10 @@ function stillConnecting(dataSource, obj, args) {
|
||||||
* @param {Object} data The model instance data
|
* @param {Object} data The model instance data
|
||||||
* @param {Function} callback The callback function (optional).
|
* @param {Function} callback The callback function (optional).
|
||||||
*/
|
*/
|
||||||
DataAccessObject.upsert = DataAccessObject.updateOrCreate = function upsert(data, callback) {
|
// [FIXME] rfeng: This is a hack to set up 'upsert' first so that
|
||||||
|
// 'upsert' will be used as the name for strong-remoting to keep it backward
|
||||||
|
// compatible for angular SDK
|
||||||
|
DataAccessObject.updateOrCreate = DataAccessObject.upsert = function upsert(data, callback) {
|
||||||
if (stillConnecting(this.getDataSource(), this, arguments)) {
|
if (stillConnecting(this.getDataSource(), this, arguments)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue