File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ export const editorSchema = BlockNoteSchema.create().extend({
1313 } ,
1414} ) ;
1515
16+ function printLog ( message :string ) {
17+ console . log ( `[${ new Date ( ) . toISOString ( ) } ] ${ message } ` ) ;
18+ }
19+
1620export function createEditor ( ) {
1721 return ServerBlockNoteEditor . create ( { schema : editorSchema } ) ;
1822}
@@ -58,7 +62,7 @@ export class OpenProjectApi implements Extension {
5862 async onLoadDocument ( data : onLoadDocumentPayload ) {
5963 const { resourceUrl } = data . context ;
6064
61- console . log ( `GET ${ resourceUrl } ` ) ;
65+ printLog ( `GET ${ resourceUrl } ` ) ;
6266
6367 const response = await fetch ( resourceUrl , {
6468 method : "GET" ,
@@ -78,6 +82,8 @@ export class OpenProjectApi implements Extension {
7882 const update = new Uint8Array ( Buffer . from ( jsonData . contentBinary , 'base64' ) ) ;
7983 Y . applyUpdate ( data . document , update ) ;
8084 }
85+
86+ return data . document ;
8187 }
8288
8389 /**
@@ -95,7 +101,7 @@ export class OpenProjectApi implements Extension {
95101 return ;
96102 }
97103
98- console . log ( `PATCH ${ resourceUrl } ` ) ;
104+ printLog ( `PATCH ${ resourceUrl } ` ) ;
99105
100106 const base64Data = Buffer . from ( Y . encodeStateAsUpdate ( data . document ) ) . toString ( "base64" ) ;
101107
You can’t perform that action at this time.
0 commit comments