mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Add in getLastEdited API call
This new HTTP API call, getLastEdited, will return the time of the last revision, in UNIX timestamp format.
This commit is contained in:
parent
0bc01feb72
commit
ab0d3c87cb
3 changed files with 26 additions and 1 deletions
|
@ -282,6 +282,24 @@ exports.getRevisionsCount = function(padID, callback)
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
getLastEdited(padID) returns the timestamp of the last revision of the pad
|
||||
|
||||
Example returns:
|
||||
|
||||
{code: 0, message:"ok", data: {lastEdited: 1340815946602}}
|
||||
{code: 1, message:"padID does not exist", data: null}
|
||||
*/
|
||||
exports.getLastEdited = function(padID, callback)
|
||||
{
|
||||
//get the pad
|
||||
getPadSafe(padID, true, function(err, pad)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
callback(null, {lastEdited: pad.getLastEdited()});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
createPad(padName [, text]) creates a new pad in this group
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue