Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Me.prototype.deleteKey return "TypeError" #228

@davideasaf

Description

@davideasaf

file: octonode/lib/octonode/me.js

Me.prototype.deleteKey = function(id, cb) { return this.client.del("/api/v3/user/keys/" + id, {}, function(err, s, b, h) { if (err) { return cb(err); } if (s !== 204) { return cb(new Error("User deleteKey error")); } else { return cb(null); } }); };

Using: Delete a public key (DELETE /user/keys/1)

When you call the function ghme.keys(1);

  • The docs do not mention a callback, but without a callback, the function always returns

TypeError: undefined is not a function

  • TypeError returns because the "Me.prototype.deleteKey" function is expecting cb to exist.
  • So why not just add a cb? -- if you add a callback to the .keys(id, cb) function, it will return the key information rather than delete it. as it says in "Get a single public key' part of the documentation

Unfortunately whenever a user tries to delete an SSH Public key via octonode, TyperError will always persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions