File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { makeChanges } from "./makeChanges.ts";
4
4
import { pull } from "./pull.ts" ;
5
5
import { pinNumber } from "./pin.ts" ;
6
6
import type { Line } from "../../deps/scrapbox.ts" ;
7
- import { ensureEditablePage , pushCommit , pushWithRetry } from "./_fetch.ts" ;
7
+ import { pushCommit , pushWithRetry } from "./_fetch.ts" ;
8
8
9
9
/** 指定したページを削除する
10
10
*
@@ -16,23 +16,22 @@ export async function deletePage(
16
16
title : string ,
17
17
) : Promise < void > {
18
18
const [
19
- { id : pageId , commitId : initialCommitId , persistent } ,
19
+ { pageId, commitId : parentId , persistent } ,
20
20
projectId ,
21
21
userId ,
22
22
] = await Promise . all ( [
23
- ensureEditablePage ( project , title ) ,
23
+ pull ( project , title ) ,
24
24
getProjectId ( project ) ,
25
25
getUserId ( ) ,
26
26
] ) ;
27
- let parentId = initialCommitId ;
28
27
29
- if ( ! persistent ) return ;
28
+ if ( persistent ) return ;
30
29
31
30
const io = await socketIO ( ) ;
32
31
const { request } = wrap ( io ) ;
33
32
34
33
try {
35
- parentId = await pushWithRetry ( request , [ { deleted : true } ] , {
34
+ await pushWithRetry ( request , [ { deleted : true } ] , {
36
35
projectId,
37
36
pageId,
38
37
parentId,
You can’t perform that action at this time.
0 commit comments