From 5a902644c1d02ba146b801b7ad2fe6885c0fadd1 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 24 Mar 2024 23:14:10 +0100 Subject: [PATCH] fix api json parse --- scripts/server-backend.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/server-backend.js b/scripts/server-backend.js index 1f901f3..73c231e 100644 --- a/scripts/server-backend.js +++ b/scripts/server-backend.js @@ -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 {