浏览代码

:art: `新建文档名模板` 改为 `新建文档存放位置` 并支持设置路径 https://github.com/siyuan-note/siyuan/issues/4494

Liang Ding 2 年之前
父节点
当前提交
2982ac75dd
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/util/newFile.ts

+ 2 - 2
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 id = Lute.NewNodeID();
         const newPath = pathPosix().join(getDisplayName(currentPath, false, true), id + ".sy");
         const newPath = pathPosix().join(getDisplayName(currentPath, false, true), id + ".sy");
         if (paths) {
         if (paths) {
             paths[paths.indexOf(undefined)] = newPath;
             paths[paths.indexOf(undefined)] = newPath;
         }
         }
-        if (!validateName(data.data.name)) {
+        if (!validateName(data.data.path)) {
             return;
             return;
         }
         }
         fetchPost("/api/filetree/createDoc", {
         fetchPost("/api/filetree/createDoc", {