From 67f123d60fd415ed6524349bb4da259f7563440a Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Mon, 5 Sep 2022 16:55:38 +0100 Subject: [PATCH 1/3] Parse incoming row as JSON --- packages/server/src/integrations/googlesheets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 129ab485cd..00a0b7f753 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -379,7 +379,7 @@ module GoogleSheetsModule { const rows = await sheet.getRows() const row = rows[query.rowIndex] if (row) { - const updateValues = query.row + const updateValues = JSON.parse(query.row) for (let key in updateValues) { row[key] = updateValues[key] } From 00f12698d73f98741010e36608345e972b09f863 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Mon, 5 Sep 2022 16:57:50 +0100 Subject: [PATCH 2/3] type check --- packages/server/src/integrations/googlesheets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 00a0b7f753..65b4325c72 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -379,7 +379,7 @@ module GoogleSheetsModule { const rows = await sheet.getRows() const row = rows[query.rowIndex] if (row) { - const updateValues = JSON.parse(query.row) + const updateValues = typeof query.row === "string" ? JSON.parse(query.row) : query.row for (let key in updateValues) { row[key] = updateValues[key] } From 2cdd47042c79ff01efe71073ad367330a7b528df Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Mon, 5 Sep 2022 16:58:35 +0100 Subject: [PATCH 3/3] lint --- packages/server/src/integrations/googlesheets.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 65b4325c72..868a9e08ce 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -379,7 +379,8 @@ module GoogleSheetsModule { const rows = await sheet.getRows() const row = rows[query.rowIndex] if (row) { - const updateValues = typeof query.row === "string" ? JSON.parse(query.row) : query.row + const updateValues = + typeof query.row === "string" ? JSON.parse(query.row) : query.row for (let key in updateValues) { row[key] = updateValues[key] }