From 0296ef113d1d57fbdd03e779d140ef2d31c55be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 3 Jul 2014 08:17:01 +0200 Subject: [PATCH] Make sure 'deleteById' is used as the remote operation name See strongloop/loopback#359 --- lib/dao.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dao.js b/lib/dao.js index 7e8194cb..bc04d80b 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -897,7 +897,10 @@ DataAccessObject.remove = DataAccessObject.deleteAll = DataAccessObject.destroyA * @param {Function} cb Callback called with (err) */ -DataAccessObject.removeById = DataAccessObject.deleteById = DataAccessObject.destroyById = function deleteById(id, cb) { +// [FIXME] rfeng: This is a hack to set up 'deleteById' first so that +// 'deleteById' will be used as the name for strong-remoting to keep it backward +// compatible for angular SDK +DataAccessObject.removeById = DataAccessObject.destroyById = DataAccessObject.deleteById = function deleteById(id, cb) { if (stillConnecting(this.getDataSource(), this, arguments)) return; var Model = this;