From ebf43ef22c7762974cabbdc43ee068c35a3fb934 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Wed, 7 Feb 2024 11:19:06 +0100 Subject: [PATCH] camelCase support in events-relay --- events-relay/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/events-relay/index.js b/events-relay/index.js index 3e85d5b..6ade6d8 100644 --- a/events-relay/index.js +++ b/events-relay/index.js @@ -84,10 +84,16 @@ app.get("/health", (req, res) => { app.post("/events", async (req, res) => { try { const reqPayload = req.body; - const webknossosUri = reqPayload.events[0].user_properties.webknossos_uri; + const webknossosUri = + reqPayload.events[0].user_properties != null + ? reqPayload.events[0].user_properties.webknossos_uri + : reqPayload.events[0].userProperties.webknossosUri; if ( reqPayload.events.some( - (ev) => ev.user_properties.webknossos_uri !== webknossosUri + (ev) => + (ev.user_properties != null + ? ev.user_properties.webknossos_uri + : ev.userProperties.webknossosUri) !== webknossosUri ) ) { res