From 00a2117cb91f2f5f1f54b31c24a758c3cf43474c Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 8 Sep 2025 11:50:38 -0600 Subject: [PATCH] map cuts updates --- map/app/controllers/cutsController.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/map/app/controllers/cutsController.js b/map/app/controllers/cutsController.js index bfbc552..d35ca77 100644 --- a/map/app/controllers/cutsController.js +++ b/map/app/controllers/cutsController.js @@ -108,7 +108,8 @@ class CutsController { is_public = false, is_official = false, geojson, - bounds + bounds, + assigned_to } = req.body; // Validate required fields @@ -149,6 +150,7 @@ class CutsController { is_official, geojson, bounds, + assigned_to, created_by: email, }; @@ -199,7 +201,8 @@ class CutsController { is_public, is_official, geojson, - bounds + bounds, + assigned_to } = req.body; // Validate GeoJSON if provided @@ -239,6 +242,7 @@ class CutsController { if (is_official !== undefined) updateData.is_official = is_official; if (geojson !== undefined) updateData.geojson = geojson; if (bounds !== undefined) updateData.bounds = bounds; + if (assigned_to !== undefined) updateData.assigned_to = assigned_to; const response = await nocodbService.update( config.nocodb.cutsSheetId, @@ -373,7 +377,7 @@ class CutsController { } // Get the cut - const cut = await nocodbService.getById(config.CUTS_TABLE_ID, id); + const cut = await nocodbService.getById(config.nocodb.cutsSheetId, id); if (!cut) { return res.status(404).json({ error: 'Cut not found' }); } @@ -433,7 +437,7 @@ class CutsController { } // Get the cut - const cut = await nocodbService.getById(config.CUTS_TABLE_ID, id); + const cut = await nocodbService.getById(config.nocodb.cutsSheetId, id); if (!cut) { return res.status(404).json({ error: 'Cut not found' }); } @@ -546,7 +550,7 @@ class CutsController { if (completion_percentage !== undefined) updateData.completion_percentage = completion_percentage; const response = await nocodbService.update( - config.CUTS_TABLE_ID, + config.nocodb.cutsSheetId, id, updateData ); @@ -576,7 +580,7 @@ class CutsController { } // Get the cut - const cut = await nocodbService.getById(config.CUTS_TABLE_ID, id); + const cut = await nocodbService.getById(config.nocodb.cutsSheetId, id); if (!cut) { return res.status(404).json({ error: 'Cut not found' }); }