refactor: externalize editor upload context

This commit is contained in:
lix-2026
2026-05-24 23:43:22 +08:00
parent 5a96ea9eba
commit 437c690a39
4 changed files with 182 additions and 1 deletions
@@ -64,6 +64,7 @@ async function uploadLocalAsset(page, root, documentId, fileName, mimeType, byte
const form = new FormData();
form.append("rootUri", rootUri);
form.append("documentId", documentId);
form.append("uploadIntent", "editor.markdown.attach");
form.append("kind", kind);
form.append("file", new File([new Uint8Array(bytes)], fileName, { type: mimeType }));
const response = await fetch("/api/local-folder/assets/upload", { method: "POST", body: form });