INNER CODE UNIT · JavaScript
TestButton
MAIF/otoroshi · otoroshi/javascript/src/extensions/catalogs/index.js:94
class TestButton extends Component {
state = {
loading: false,
result: null,
};
handleTest = () => {
const { rawValue } = this.props;
if (!rawValue || !rawValue.id) return;
this.setState({ loading: true, result: null }, () => {
fetch('/extensions/remote-catalogs/_test', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
id: rawValue.id,
args: rawValue.test_deploy_args || {},
}),