From 0e162f5f54b5c5915167b0075c90de3a338064b7 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Apr 2021 13:14:24 +0530 Subject: [PATCH 1/2] Fix 500 server error --- cs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cs.js b/cs.js index e46767f..65102e1 100644 --- a/cs.js +++ b/cs.js @@ -1,12 +1,12 @@ function patchGQLQuery(obj) { team_condition = {"state":{"_eq":"soft_launched"}}; - where_clause = obj["variables"]["where"]; - if(where_clause === null || where_clause === undefined){ - where_clause = {}; + report_clause = obj["variables"]["where"]["report"]; + if(report_clause === null || report_clause === undefined){ + report_clause = {}; } - where_clause["team"] = team_condition; - obj["variables"]["where"] = where_clause; + report_clause["team"] = team_condition; + obj["variables"]["report"] = report_clause; console.log(obj); return obj; } From 9812eb8482680abb0e640d057d6ce2102545d07f Mon Sep 17 00:00:00 2001 From: Yash Sodha <11671053+yashrs@users.noreply.github.com> Date: Tue, 27 Apr 2021 02:38:41 +0530 Subject: [PATCH 2/2] Added correct key to add the report object --- cs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cs.js b/cs.js index 65102e1..e16e0d2 100644 --- a/cs.js +++ b/cs.js @@ -6,7 +6,7 @@ function patchGQLQuery(obj) report_clause = {}; } report_clause["team"] = team_condition; - obj["variables"]["report"] = report_clause; + obj["variables"]["where"]["report"] = report_clause; console.log(obj); return obj; }