diff --git a/NodeSrv/apps/healthcheck-survey-bot/workflows/hc-wp-status-push.json b/NodeSrv/apps/healthcheck-survey-bot/workflows/hc-wp-status-push.json index da46c23d..cc37724b 100644 --- a/NodeSrv/apps/healthcheck-survey-bot/workflows/hc-wp-status-push.json +++ b/NodeSrv/apps/healthcheck-survey-bot/workflows/hc-wp-status-push.json @@ -20,7 +20,7 @@ }, { "id": "dt-get-healthcheck_wp_api_key", - "name": "HEALTHCHECK_WP_API_KEY取得", + "name": "設定値一括取得", "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ @@ -34,14 +34,6 @@ "mode": "id", "value": "bNkadTyDgDepYx2p" }, - "filters": { - "conditions": [ - { - "keyName": "configKey", - "keyValue": "HEALTHCHECK_WP_API_KEY" - } - ] - }, "returnAll": true } }, @@ -55,7 +47,7 @@ 300 ], "parameters": { - "jsCode": "const expectedApiKey = $('HEALTHCHECK_WP_API_KEY取得').item.json.configValue;\nconst headers = $input.first().json.headers || {};\nif (headers[\"x-api-key\"] !== expectedApiKey) {\n throw new Error(\"Unauthorized: invalid API key\");\n}\nconst body = $input.first().json.body || {};\nif (!body.resultId || !body.processId) {\n throw new Error(\"Bad Request: resultId, processId は必須です\");\n}\nreturn [{ json: { resultId: body.resultId, processId: body.processId } }];" + "jsCode": "const configRows = $('設定値一括取得').all().map((item) => item.json);\nconst expectedApiKey = configRows.find((row) => row.configKey === \"HEALTHCHECK_WP_API_KEY\")?.configValue;\nconst headers = $input.first().json.headers || {};\nif (headers[\"x-api-key\"] !== expectedApiKey) {\n throw new Error(\"Unauthorized: invalid API key\");\n}\nconst body = $input.first().json.body || {};\nif (!body.resultId || !body.processId) {\n throw new Error(\"Bad Request: resultId, processId は必須です\");\n}\nreturn [{ json: { resultId: body.resultId, processId: body.processId } }];" } }, { @@ -103,14 +95,14 @@ "main": [ [ { - "node": "HEALTHCHECK_WP_API_KEY取得", + "node": "設定値一括取得", "type": "main", "index": 0 } ] ] }, - "HEALTHCHECK_WP_API_KEY取得": { + "設定値一括取得": { "main": [ [ {