MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / _init

Function _init

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

Source from the content-addressed store, hash-verified

80 }, []);
81
82 const _init = () => {
83 if (editConnection) {
84 const newConnection = editConnection;
85 // format the options
86 if (newConnection.options && newConnection.options.length > 0) {
87 const formattedOptions = [];
88 for (let i = 0; i < newConnection.options.length; i++) {
89 if (newConnection.options[i]) {
90 formattedOptions.push({
91 id: uuid(),
92 key: Object.keys(newConnection.options[i])[0],
93 value: newConnection.options[i][Object.keys(newConnection.options[i])[0]],
94 });
95 }
96 }
97
98 newConnection.optionsArray = formattedOptions;
99 } else {
100 newConnection.optionsArray = [];
101 }
102
103 setConnection(newConnection);
104 }
105 };
106
107 const _onTestRequest = (data) => {
108 const newTestResult = {};

Callers 1

ApiConnectionFormFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected