mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-18 09:48:12 +00:00
(js) Resource.post: argument 'id' is optional
This commit is contained in:
1 parent
fc3c362515
commit
523532b153
1 file changed
+4
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user