Skip to content

Commit

Permalink
fix api json parse
Browse files Browse the repository at this point in the history
  • Loading branch information
cracker0dks committed Mar 24, 2024
1 parent 037e1a6 commit 5a90264
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/server-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,17 @@ export default function startBackendServer(port) {
// broadcast the same query to the associated read-only whiteboard
const readOnlyId = ReadOnlyBackendService.getReadOnlyId(wid);
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
res.send("done");
} else {
Expand Down

0 comments on commit 5a90264

Please sign in to comment.