@gavdi/cap-mcp 1.4.0 → 1.4.1
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.
- package/lib/mcp/entity-tools.js +4 -12
- package/package.json +1 -1
package/lib/mcp/entity-tools.js
CHANGED
|
@@ -404,16 +404,12 @@ function registerCreateTool(resAnno, server, authEnabled) {
|
|
|
404
404
|
// Regular association - use foreign key
|
|
405
405
|
const fkName = `${propName}_ID`;
|
|
406
406
|
if (args[fkName] !== undefined) {
|
|
407
|
-
|
|
408
|
-
data[fkName] =
|
|
409
|
-
typeof val === "string" && /^\d+$/.test(val) ? Number(val) : val;
|
|
407
|
+
data[fkName] = args[fkName];
|
|
410
408
|
}
|
|
411
409
|
continue;
|
|
412
410
|
}
|
|
413
411
|
if (args[propName] !== undefined) {
|
|
414
|
-
|
|
415
|
-
data[propName] =
|
|
416
|
-
typeof val === "string" && /^\d+$/.test(val) ? Number(val) : val;
|
|
412
|
+
data[propName] = args[propName];
|
|
417
413
|
}
|
|
418
414
|
}
|
|
419
415
|
const tx = svc.tx({ user: (0, utils_1.getAccessRights)(authEnabled) });
|
|
@@ -527,16 +523,12 @@ function registerUpdateTool(resAnno, server, authEnabled) {
|
|
|
527
523
|
// Regular association - use foreign key
|
|
528
524
|
const fkName = `${propName}_ID`;
|
|
529
525
|
if (args[fkName] !== undefined) {
|
|
530
|
-
|
|
531
|
-
updates[fkName] =
|
|
532
|
-
typeof val === "string" && /^\d+$/.test(val) ? Number(val) : val;
|
|
526
|
+
updates[fkName] = args[fkName];
|
|
533
527
|
}
|
|
534
528
|
continue;
|
|
535
529
|
}
|
|
536
530
|
if (args[propName] !== undefined) {
|
|
537
|
-
|
|
538
|
-
updates[propName] =
|
|
539
|
-
typeof val === "string" && /^\d+$/.test(val) ? Number(val) : val;
|
|
531
|
+
updates[propName] = args[propName];
|
|
540
532
|
}
|
|
541
533
|
}
|
|
542
534
|
if (Object.keys(updates).length === 0) {
|