mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 22:53:18 +00:00
(js) Resource.post: argument 'id' is optional
This commit is contained in:
@@ -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