Fixed a bug where user couldn't craewte boards from templates (#1319)
This commit is contained in:
parent
a8da028bc7
commit
0f9486262e
2 changed files with 3 additions and 3 deletions
|
@ -645,7 +645,7 @@ class Mutator {
|
|||
beforeUndo?: () => Promise<void>,
|
||||
): Promise<[Block[], string]> {
|
||||
const rootClient = new OctoClient(octoClient.serverUrl, '0')
|
||||
const blocks = await rootClient.getSubtree(boardId, 3)
|
||||
const blocks = await rootClient.getSubtree(boardId, 3, '0')
|
||||
const [newBlocks1, newBoard] = OctoUtils.duplicateBlockTree(blocks, boardId) as [Block[], Board, Record<string, string>]
|
||||
const newBlocks = newBlocks1.filter((o) => o.type !== 'comment')
|
||||
Utils.log(`duplicateBoard: duplicating ${newBlocks.length} blocks`)
|
||||
|
|
|
@ -166,8 +166,8 @@ class OctoClient {
|
|||
return user
|
||||
}
|
||||
|
||||
async getSubtree(rootId?: string, levels = 2): Promise<Block[]> {
|
||||
let path = this.workspacePath() + `/blocks/${encodeURIComponent(rootId || '')}/subtree?l=${levels}`
|
||||
async getSubtree(rootId?: string, levels = 2, workspaceID?: string): Promise<Block[]> {
|
||||
let path = this.workspacePath(workspaceID) + `/blocks/${encodeURIComponent(rootId || '')}/subtree?l=${levels}`
|
||||
const readToken = this.readToken()
|
||||
if (readToken) {
|
||||
path += `&read_token=${readToken}`
|
||||
|
|
Loading…
Reference in a new issue