Skip to content

Commit 821fa10

Browse files
committed
adapt stored excalidraw json to make files importable on excalidraw.com
Signed-off-by: grnd-alt <[email protected]>
1 parent 48d7306 commit 821fa10

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

websocket_server/ApiService.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ export default class ApiService {
5959
console.log(`[${roomID}] Saving room data to server: ${roomData.length} elements, ${Object.keys(files).length} files`)
6060

6161
const url = `${this.NEXTCLOUD_URL}/index.php/apps/whiteboard/${roomID}`
62-
const body = { data: { elements: roomData, files: this.cleanupFiles(roomData, files) } }
62+
const body = {
63+
data: {
64+
type: "excalidraw",
65+
version: 2,
66+
elements: roomData,
67+
files: this.cleanupFiles(roomData, files)
68+
}
69+
}
6370
const options = this.fetchOptions('PUT', null, body, roomID, lastEditedUser)
6471
return this.fetchData(url, options)
6572
}

0 commit comments

Comments
 (0)