From 2982ac75ddcbf0e14ea562292e8f3380d91b0777 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 3 Feb 2023 21:03:30 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20`=E6=96=B0=E5=BB=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=90=8D=E6=A8=A1=E6=9D=BF`=20=E6=94=B9=E4=B8=BA=20`=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E6=A1=A3=E5=AD=98=E6=94=BE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?`=20=E5=B9=B6=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=20https://github.com/siyuan-note/siyuan/issues/4494?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/util/newFile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index 58746ff09..bf6f2640b 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -53,13 +53,13 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea } }); } - fetchPost("/api/filetree/getDocNameTemplate", {notebook: notebookId}, (data) => { + fetchPost("/api/filetree/getDocCreateSavePath", {notebook: notebookId}, (data) => { const id = Lute.NewNodeID(); const newPath = pathPosix().join(getDisplayName(currentPath, false, true), id + ".sy"); if (paths) { paths[paths.indexOf(undefined)] = newPath; } - if (!validateName(data.data.name)) { + if (!validateName(data.data.path)) { return; } fetchPost("/api/filetree/createDoc", {