From dde3f059ce20e6ab9bea19b6e470cc4c738dbc30 Mon Sep 17 00:00:00 2001 From: esurface Date: Tue, 23 Jul 2024 13:55:18 -0400 Subject: [PATCH] Fix addition of tangerineModifiedOn and tangerineModifiedByUserId to mysql-js outputs --- server/src/modules/mysql-js/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/modules/mysql-js/index.js b/server/src/modules/mysql-js/index.js index c42d968e4..29e7a1726 100644 --- a/server/src/modules/mysql-js/index.js +++ b/server/src/modules/mysql-js/index.js @@ -328,6 +328,7 @@ const getItemValue = (doc, variableName) => { const generateFlatResponse = async function (formResponse, sanitized) { const groupId = formResponse.groupId; + // Anything added to this list need to be added to the valuesToRemove list in each of the convert_response function. let flatFormResponse = { _id: formResponse._id, formTitle: formResponse.form.title, @@ -782,7 +783,7 @@ async function convert_response(knex, doc, groupId, tableName) { // # Delete the following keys; - const valuesToRemove = ['_id', '_rev','buildChannel','buildId','caseEventId','deviceId','eventFormId','eventId','groupId','participantId','startDatetime', 'startUnixtime'] + const valuesToRemove = ['_id', '_rev','buildChannel','buildId','caseEventId','deviceId','eventFormId','eventId','groupId','participantId','startDatetime', 'startUnixtime', 'tangerineModifiedOn', 'tangerineModifiedByUserId'] valuesToRemove.forEach(e => delete doc[e]); const cleanData = populateDataFromDocument(doc, data); return cleanData