INNER CODE UNIT · JavaScript
setupRemoteCatalogsExtension
MAIF/otoroshi · otoroshi/javascript/src/extensions/catalogs/index.js:9
export function setupRemoteCatalogsExtension(registerExtension) {
registerExtension(extensionId, true, (ctx) => {
class DeployButton extends Component {
state = {
loading: false,
result: null,
};
handleDeploy = () => {
const { rawValue } = this.props;
if (!rawValue || !rawValue.id) return;
this.setState({ loading: true, result: null }, () => {
fetch('/extensions/remote-catalogs/_deploy', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify([{ id: rawValue.id, args: rawValue.test_deploy_args || {} }]),
})