mirror of
https://github.com/docmost/docmost.git
synced 2025-11-17 07:31:10 +10:00
feat: excalidraw integration (#214)
* update tiptap version * excalidraw init * cleanup * better file handling and other fixes * use different modal to fix excalidraw cursor position issue * see https://github.com/excalidraw/excalidraw/issues/7312 * fix websocket in vite dev mode * WIP * add align attribute * fix table * menu icons * Render image in excalidraw html * add size to custom SVG components * rewrite undefined font urls
This commit is contained in:
@ -81,10 +81,14 @@ export async function importPage(file: File, spaceId: string) {
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function uploadFile(file: File, pageId: string) {
|
||||
export async function uploadFile(file: File, pageId: string, attachmentId?: string): Promise<IAttachment> {
|
||||
const formData = new FormData();
|
||||
if(attachmentId){
|
||||
formData.append("attachmentId", attachmentId);
|
||||
}
|
||||
formData.append("pageId", pageId);
|
||||
formData.append("file", file);
|
||||
|
||||
|
||||
const req = await api.post<IAttachment>("/files/upload", formData, {
|
||||
headers: {
|
||||
@ -92,5 +96,5 @@ export async function uploadFile(file: File, pageId: string) {
|
||||
},
|
||||
});
|
||||
|
||||
return req;
|
||||
return req as unknown as IAttachment;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user