MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / _onTestRequest

Function _onTestRequest

client/src/sources/api/api-connection-form.jsx:107–125  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

105 };
106
107 const _onTestRequest = (data) => {
108 const newTestResult = {};
109 return dispatch(testRequest({ team_id: team.id, connection: data }))
110 .then(async (response) => {
111 newTestResult.status = response.payload.status;
112 newTestResult.body = await response.payload.text();
113
114 try {
115 newTestResult.body = JSON.parse(newTestResult.body);
116 newTestResult.body = JSON.stringify(newTestResult, null, 2);
117 } catch (e) {
118 // the response is not in JSON format
119 }
120
121 setTestResult(newTestResult);
122 return Promise.resolve(newTestResult);
123 })
124 .catch(() => { });
125 };
126
127 const _onCreateConnection = (test = false) => {
128 setErrors({});

Callers 1

_onCreateConnectionFunction · 0.70

Calls 2

testRequestFunction · 0.90
dispatchFunction · 0.50

Tested by

no test coverage detected