⚡Creating a Action
Arguments
Name
Type
Description
Example
<script>
$fetch.createAction("my_action", {
options: {
url: 'https://jsonplaceholder.typicode.com/todos/',
method: 'post',
headers: [{
key: 'Content-Type',
value: 'application/json'
}],
body: [{
key: 'title',
value: 'My todo item'
}]
},
events: {
onRequestInit: {
callback: null
},
onSuccess: {
redirectUrl: null,
showElement: null,
hideElement: null,
callback: null
}
onError: {
redirectUrl: null,
showElement: null,
hideElement: null,
callback: null
}
},
});
</script>Last updated