diff --git a/java/google/registry/ui/js/resource.js b/java/google/registry/ui/js/resource.js index f01105a00..c58bfe5ea 100644 --- a/java/google/registry/ui/js/resource.js +++ b/java/google/registry/ui/js/resource.js @@ -39,8 +39,8 @@ goog.inherits(registry.Resource, registry.Session); /** * Get the resource from the server. * - * @param {!Object} args Params for server. Do not set the 'op' field on args. - * @param {!Function} callback For retrieved resource. + * @param {!Object} args Params for server. + * @param {!Function} callback for retrieved resource. */ registry.Resource.prototype.read = function(args, callback) { this.send_('read', args, callback); @@ -48,22 +48,9 @@ registry.Resource.prototype.read = function(args, callback) { /** - * Create the resource on the server. + * Update the resource on the server. * - * @param {!Object} args params for server. Do not set the 'op' field on args. - * @param {!Function} callback on success. - * @param {string} newId name for the new resource. - * @throws {!Exception} if the 'op' field is set on args. - */ -registry.Resource.prototype.create = function(args, callback, newId) { - this.send_('create', args, callback, newId); -}; - - -/** - * Create the resource on the server. - * - * @param {!Object} args params for server. Do not set the 'op' field on args. + * @param {!Object} args params for server. * @param {!Function} callback on success. * @throws {!Exception} if the 'op' field is set on args. */ @@ -78,17 +65,13 @@ registry.Resource.prototype.update = function(args, callback) { * @param {string} opCode One of (create|read|update) * @param {!Object} argsObj arguments for the operation. * @param {!Function} callback For XhrIo result throws. - * @param {string=} opt_newId name for the new resource. * @private */ registry.Resource.prototype.send_ = - function(opCode, argsObj, callback, opt_newId) { + function(opCode, argsObj, callback) { // NB: must be declared this way in order to avoid compiler renaming var req = {}; req['op'] = opCode; req['args'] = argsObj; - if (opt_newId) { - this.uri.setPath(this.uri.getPath() + '/' + opt_newId); - } this.sendXhrIo(goog.json.serialize(req), callback); };