(val: any)
| 112 | ), |
| 113 | },) |
| 114 | const handleEdit = async (val: any) => { |
| 115 | setLoading(true) |
| 116 | setTipSchema(false) |
| 117 | const res = await getActionsDetail(val.action_id) |
| 118 | const formattedData = JSON.stringify(res.data.openapi_schema, null, 4); |
| 119 | setDrawerTitle(`${t('projectToolsEditAction')}`) |
| 120 | setActionId(val.action_id) |
| 121 | setSchema(formattedData) |
| 122 | if (res.data.authentication) { |
| 123 | if (res.data.authentication.content) { |
| 124 | setRadioValue('custom') |
| 125 | setCustom(Object.keys(res.data.authentication.content)[0]) |
| 126 | setAuthentication(Object.values(res.data.authentication.content)[0] as string) |
| 127 | } else { |
| 128 | setRadioValue(res.data.authentication.type) |
| 129 | setAuthentication(res.data.authentication.secret) |
| 130 | } |
| 131 | } else { |
| 132 | setRadioValue('none') |
| 133 | setAuthentication('') |
| 134 | } |
| 135 | setLoading(false) |
| 136 | setOpenDrawer(true) |
| 137 | } |
| 138 | const handleRequest = async () => { |
| 139 | |
| 140 | if (!schema) { |
no test coverage detected