From ff88c19fc12887a49fdb752adb15ee3145f521f0 Mon Sep 17 00:00:00 2001 From: Manuel Knitza Date: Mon, 11 Feb 2013 07:40:03 +0100 Subject: [PATCH] Add API endpoint to return padID for a readOnlyID --- src/node/db/API.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/node/db/API.js b/src/node/db/API.js index 07141fec2..12fdabac5 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -460,6 +460,24 @@ exports.getReadOnlyID = function(padID, callback) }); } +/** +getPadID(readonlyID) returns the normal link of a pad + +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; + callback(null, {PadID: PadId}); + }); +} + /** setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad