mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Feature: Copy Pad without history (#4295)
New feature to copy a pad without copying entire history. This is useful to perform a low CPU intensive operation while still copying current pad state.
This commit is contained in:
parent
b80a37173e
commit
8c04fe8775
5 changed files with 259 additions and 36 deletions
|
@ -597,6 +597,21 @@ exports.copyPad = async function(sourceID, destinationID, force)
|
|||
await pad.copy(destinationID, force);
|
||||
}
|
||||
|
||||
/**
|
||||
copyPadWithoutHistory(sourceID, destinationID[, force=false]) copies a pad. If force is true,
|
||||
the destination will be overwritten if it exists.
|
||||
|
||||
Example returns:
|
||||
|
||||
{code: 0, message:"ok", data: {padID: destinationID}}
|
||||
{code: 1, message:"padID does not exist", data: null}
|
||||
*/
|
||||
exports.copyPadWithoutHistory = async function(sourceID, destinationID, force)
|
||||
{
|
||||
let pad = await getPadSafe(sourceID, true);
|
||||
await pad.copyPadWithoutHistory(destinationID, force);
|
||||
}
|
||||
|
||||
/**
|
||||
movePad(sourceID, destinationID[, force=false]) moves a pad. If force is true,
|
||||
the destination will be overwritten if it exists.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue