fix api json parse

This commit is contained in:
Raphael 2024-03-24 23:14:10 +01:00
parent 037e1a6a99
commit 5a902644c1

View File

@ -225,6 +225,17 @@ export default function startBackendServer(port) {
// broadcast the same query to the associated read-only whiteboard // broadcast the same query to the associated read-only whiteboard
const readOnlyId = ReadOnlyBackendService.getReadOnlyId(wid); const readOnlyId = ReadOnlyBackendService.getReadOnlyId(wid);
broadcastTo(readOnlyId); broadcastTo(readOnlyId);
try {
query.th = parseFloat(query.th);
} catch(e) {
//Dont do a thing
}
try {
query.d = JSON.parse(query.d)
} catch(e) {
//Dont do a thing
}
s_whiteboard.handleEventsAndData(query); //save whiteboardchanges on the server s_whiteboard.handleEventsAndData(query); //save whiteboardchanges on the server
res.send("done"); res.send("done");
} else { } else {