Desistir venta

This commit is contained in:
2023-12-21 18:45:47 -03:00
parent 93431e41b3
commit 80a6bf1535
8 changed files with 221 additions and 62 deletions

View File

@ -12,7 +12,14 @@
if (!Object.hasOwn(options['headers'], 'Authorization')) {
options['headers']['Authorization'] = 'Bearer {{md5($API_KEY)}}'
}
return fetch(url, options)
return fetch(url, options).then(response => {
if (response.ok) {
return response
}
throw new Error(JSON.stringify({code: response.status, message: response.statusText, url}))
}).catch(error => {
console.error(error)
})
}
const calendar_date_options = {
type: 'date',