You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/03/28 04:21:11 UTC

[3/9] git commit: allow non-uuid identifiers

allow non-uuid identifiers


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/454ab6ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/454ab6ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/454ab6ee

Branch: refs/heads/master
Commit: 454ab6ee74a9d112a5a7890fec174e2ab9d2592c
Parents: 70c4f01
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Fri Mar 21 13:57:20 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Fri Mar 21 13:57:20 2014 -0700

----------------------------------------------------------------------
 sdks/nodejs/lib/usergrid.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/454ab6ee/sdks/nodejs/lib/usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/nodejs/lib/usergrid.js b/sdks/nodejs/lib/usergrid.js
index 9140f14..95beb6a 100755
--- a/sdks/nodejs/lib/usergrid.js
+++ b/sdks/nodejs/lib/usergrid.js
@@ -1066,17 +1066,17 @@ var AUTH_NONE = 'NONE';
   Usergrid.Entity.prototype.destroy = function (callback) {
     var self = this;
     var type = this.get('type');
-    if (isUUID(this.get('uuid'))) {
-      type += '/' + this.get('uuid');
-    } else {
+    var id = this.getEntityId(this);
+    if (!id) {
       if (typeof(callback) === 'function') {
-        var error = 'Error trying to delete object - no uuid specified.';
+        var error = 'Error trying to delete object - no uuid or name specified.';
         if (self._client.logging) {
           console.log(error);
         }
         callback(true, error);
       }
     }
+    type += '/' + this.get('uuid');
     var options = {
       method:'DELETE',
       endpoint:type