Comparing version 0.2.3 to 0.3.0
@@ -16,3 +16,2 @@ /** | ||
* @param {Entity} Entity An Entity instance or ctor. | ||
* @param {string} baseUrl The base url. | ||
* @param {Object=} optOpts Optionally define options. | ||
@@ -22,6 +21,6 @@ * @contructor | ||
*/ | ||
var CrudCtrl = module.exports = CrudCmd.extend(function(Entity, baseUrl, optOpts) { | ||
var CrudCtrl = module.exports = CrudCmd.extend(function(Entity, optOpts) { | ||
/** @type {Object} define default options */ | ||
this.opts = { | ||
baseUrl: baseUrl, | ||
baseUrl: 'crude', | ||
urlField: 'localUrl', | ||
@@ -41,4 +40,2 @@ nameField: 'name', | ||
}; | ||
/** @type {?string} The base url for the resource */ | ||
this.baseUrl = baseUrl; | ||
@@ -119,6 +116,15 @@ if (__.isObject(optOpts)) { | ||
CrudCtrl.prototype.getBaseUrl = function(/* req */) { | ||
return this.baseUrl; | ||
return this.opts.baseUrl; | ||
}; | ||
/** | ||
* Set the baseUrl. | ||
* | ||
* @param {string} baseUrl The base url. | ||
*/ | ||
CrudCtrl.prototype.setBaseUrl = function(baseUrl) { | ||
this.opts.baseUrl = baseUrl; | ||
}; | ||
/** | ||
* Prepare the response object for each request, an internal middleware. | ||
@@ -125,0 +131,0 @@ * |
{ | ||
"name": "crude", | ||
"description": "Seamless CRUD control operations for node.", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"homepage": "https://github.com/talksession/node-crude", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -32,2 +32,4 @@ # node-crude | ||
## Release History | ||
- **v0.3.0**, *22 Feb 2014* | ||
- Changed constructor signature, now only accepts an Entity and optional options. | ||
- **v0.2.3**, *19 Feb 2014* | ||
@@ -34,0 +36,0 @@ - Upgrade all dependencies to latest. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30237
737
68