Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug where the user couldn't create boards from templates #1319

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webapp/src/mutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/octoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down