@layer-ai/core 0.8.7 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/gates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,MAAM,EAAE,UAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/gates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,MAAM,EAAE,UAAqB,CAAC;AAidpC,eAAe,MAAM,CAAC"}
|
package/dist/routes/v1/gates.js
CHANGED
|
@@ -128,8 +128,6 @@ router.patch('/name/:name', async (req, res) => {
|
|
|
128
128
|
res.status(400).json({ error: 'bad_request', message: `Unsupported model: ${model}` });
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
// Create history snapshot before update
|
|
132
|
-
await db.createGateHistory(existing.id, existing, 'user');
|
|
133
131
|
const updated = await db.updateGate(existing.id, {
|
|
134
132
|
description,
|
|
135
133
|
taskType,
|
|
@@ -149,6 +147,10 @@ router.patch('/name/:name', async (req, res) => {
|
|
|
149
147
|
reanalysisPeriod,
|
|
150
148
|
taskAnalysis,
|
|
151
149
|
});
|
|
150
|
+
// Create history snapshot after update with the updated values
|
|
151
|
+
if (updated) {
|
|
152
|
+
await db.createGateHistory(existing.id, updated, 'user');
|
|
153
|
+
}
|
|
152
154
|
// Log manual update activity
|
|
153
155
|
await db.createActivityLog(existing.id, req.userId, 'manual_update', {
|
|
154
156
|
changedFields: Object.keys(req.body)
|
|
@@ -182,8 +184,6 @@ router.patch('/:id', async (req, res) => {
|
|
|
182
184
|
res.status(400).json({ error: 'bad_request', message: `Unsupported model: ${model}` });
|
|
183
185
|
return;
|
|
184
186
|
}
|
|
185
|
-
// Create history snapshot before update
|
|
186
|
-
await db.createGateHistory(req.params.id, existing, 'user');
|
|
187
187
|
const updated = await db.updateGate(req.params.id, {
|
|
188
188
|
name,
|
|
189
189
|
description,
|
|
@@ -204,6 +204,10 @@ router.patch('/:id', async (req, res) => {
|
|
|
204
204
|
reanalysisPeriod,
|
|
205
205
|
taskAnalysis,
|
|
206
206
|
});
|
|
207
|
+
// Create history snapshot after update with the updated values
|
|
208
|
+
if (updated) {
|
|
209
|
+
await db.createGateHistory(req.params.id, updated, 'user');
|
|
210
|
+
}
|
|
207
211
|
// Log manual update activity
|
|
208
212
|
await db.createActivityLog(req.params.id, req.userId, 'manual_update', {
|
|
209
213
|
changedFields: Object.keys(req.body)
|