Hey, I have a problem with cancelling a job, my code looks like this:
if (reservation_data.trigger_dev_job_id) {
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer token',
'Content-Type': 'application/json',
}
};
await fetch(`https://api.trigger.dev/api/v1/events/${ reservation_data.trigger_dev_job_id }/cancel`, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
}
Am I doing something wrong or any ideas?