Implemented the the new API method getPadID for reversing the Readonly ID. Based on: ff88c19fc1

This commit is contained in:
Stephan Jauernick 2014-05-31 00:43:31 +02:00
parent 493636ec36
commit fffdde0c59
1 changed files with 26 additions and 0 deletions

View File

@ -640,6 +640,32 @@ exports.getReadOnlyID = function(padID, callback)
});
}
/**
getPadID(roID) returns the padID of a pad based on the readonlyID(roID)
Example returns:
{code: 0, message:"ok", data: null}
{code: 1, message:"padID does not exist", data: null}
*/
exports.getPadID = function(roID, callback)
{
//get the PadId
readOnlyManager.getPadId(roID, function(err, padID)
{
if(ERR(err, callback)) return;
if(padID == null)
{
callback(new customError("padID does not exist","apierror"));
}
else
{
callback(null, {PadID: padID});
}
});
}
/**
setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad