From 419b9cecc1894fb735da008896a5b30f1ba886f9 Mon Sep 17 00:00:00 2001 From: "Michael.Taylor" Date: Mon, 3 Jan 2022 13:51:24 -0500 Subject: [PATCH] fix: dont commit staging records that have already been commited --- src/controllers/staging.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/staging.controller.js b/src/controllers/staging.controller.js index 57d220d5..05549e79 100644 --- a/src/controllers/staging.controller.js +++ b/src/controllers/staging.controller.js @@ -75,7 +75,7 @@ export const commit = async (req, res) => { { where: { id: stagingRecordId } }, ); - if (table === 'Projects') { + if (table === 'Projects' && !commited) { switch (action) { case 'INSERT': fullNode.createProjectRecord(uuid, data, stagingRecordId); @@ -87,7 +87,7 @@ export const commit = async (req, res) => { fullNode.deleteProjectRecord(uuid, stagingRecordId); break; } - } else if (table === 'Unit') { + } else if (table === 'Unit' && !commited) { switch (action) { case 'INSERT': fullNode.createUnitRecord(uuid, data, stagingRecordId);