From 523532b153d24aecbd740957855402068c657905 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 1 May 2015 09:54:49 -0400 Subject: [PATCH] (js) Resource.post: argument 'id' is optional --- UI/WebServerResources/js/Common/resource.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Common/resource.js b/UI/WebServerResources/js/Common/resource.js index 15f47245a..c3439e0f7 100644 --- a/UI/WebServerResources/js/Common/resource.js +++ b/UI/WebServerResources/js/Common/resource.js @@ -130,7 +130,10 @@ */ Resource.prototype.post = function(id, action, data) { var deferred = this._q.defer(), - path = this._path + '/' + id + '/' + action; + path = [this._path]; + if (id) path.push(id); + if (action) path.push(action); + path = _.compact(_.flatten(path)).join('/'); this._http .post(path, data)