@@ -9,7 +9,6 @@ import { BlockNoteEditor } from "@/components/DynamicBlockNoteEditor";
99import { Button } from "@/components/ui/button" ;
1010import { Card , CardContent , CardDescription , CardHeader , CardTitle } from "@/components/ui/card" ;
1111import { Separator } from "@/components/ui/separator" ;
12- import { cn } from "@/lib/utils" ;
1312
1413interface EditorContent {
1514 document_id : number ;
@@ -97,35 +96,7 @@ export default function EditorPage() {
9796 }
9897 } , [ editorContent , document ] ) ;
9998
100- // Auto-save every 30 seconds - DIRECT CALL TO FASTAPI
101- useEffect ( ( ) => {
102- if ( ! editorContent || ! token || ! hasUnsavedChanges ) return ;
103-
104- const interval = setInterval ( async ( ) => {
105- try {
106- const response = await fetch (
107- `${ process . env . NEXT_PUBLIC_FASTAPI_BACKEND_URL } /api/v1/documents/${ documentId } /blocknote-content` ,
108- {
109- method : "PUT" ,
110- headers : {
111- "Content-Type" : "application/json" ,
112- Authorization : `Bearer ${ token } ` ,
113- } ,
114- body : JSON . stringify ( { blocknote_document : editorContent } ) ,
115- }
116- ) ;
117-
118- if ( response . ok ) {
119- setHasUnsavedChanges ( false ) ;
120- toast . success ( "Auto-saved" , { duration : 2000 } ) ;
121- }
122- } catch ( error ) {
123- console . error ( "Auto-save failed:" , error ) ;
124- }
125- } , 30000 ) ; // 30 seconds
126-
127- return ( ) => clearInterval ( interval ) ;
128- } , [ editorContent , documentId , token , hasUnsavedChanges ] ) ;
99+ // TODO: Auto-save every 30 seconds - DIRECT CALL TO FASTAPI
129100
130101 // Save and exit - DIRECT CALL TO FASTAPI
131102 const handleSave = async ( ) => {
0 commit comments