map cuts updates

This commit is contained in:
admin 2025-09-08 11:50:38 -06:00
parent bc08f0b55d
commit 00a2117cb9

View File

@ -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' });
}