|
@@ -90,22 +90,25 @@ router.put("/:id", async (req, res) => {
|
|
|
WHERE tools_id = ?
|
|
|
`;
|
|
|
|
|
|
- await executeQuery(sql, [
|
|
|
- tools_name,
|
|
|
- tools_function_name,
|
|
|
- tools_full_name,
|
|
|
- tools_desc,
|
|
|
- tools_version,
|
|
|
- access_task_id,
|
|
|
- status,
|
|
|
- call_type,
|
|
|
- api_provider,
|
|
|
- api_url_path,
|
|
|
- operate_path_data,
|
|
|
- params_definition,
|
|
|
- response_desc,
|
|
|
+ // 将 undefined 值转换为 null,避免数据库绑定参数错误
|
|
|
+ const params = [
|
|
|
+ tools_name ?? null,
|
|
|
+ tools_function_name ?? null,
|
|
|
+ tools_full_name ?? null,
|
|
|
+ tools_desc ?? null,
|
|
|
+ tools_version ?? null,
|
|
|
+ access_task_id ?? null,
|
|
|
+ status ?? null,
|
|
|
+ call_type ?? null,
|
|
|
+ api_provider ?? null,
|
|
|
+ api_url_path ?? null,
|
|
|
+ operate_path_data ?? null,
|
|
|
+ params_definition ?? null,
|
|
|
+ response_desc ?? null,
|
|
|
id,
|
|
|
- ]);
|
|
|
+ ];
|
|
|
+
|
|
|
+ await executeQuery(sql, params);
|
|
|
|
|
|
res.json({ message: "Tool updated successfully" });
|
|
|
} catch (error) {
|