FIX: Remove login for API

This commit is contained in:
2023-11-25 00:55:31 -03:00
parent 3cadaca746
commit ec7d8e69ab
34 changed files with 140 additions and 71 deletions

View File

@ -339,7 +339,7 @@
$(this.ids.buttons.add).hide()
return fetch('{{$urls->api}}/proyectos').then(response => {
return fetchAPI('{{$urls->api}}/proyectos').then(response => {
if (response.ok) {
return response.json()
}
@ -357,7 +357,7 @@
},
precios: proyecto_id => {
this.data.precios = []
return fetch('{{$urls->api}}/ventas/precios',
return fetchAPI('{{$urls->api}}/ventas/precios',
{method: 'post', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({proyecto_id})}
).then(response => {
$('.item.proyecto').css('cursor', 'default')
@ -639,7 +639,7 @@
fecha: $(this.ids.fields.calendar).calendar('get date'),
valor: $(this.ids.fields.valor).val()
}
return fetch('{{$urls->api}}/precios/update',
return fetchAPI('{{$urls->api}}/precios/update',
{method: 'post', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(data)}
).then(response => {
if (response.ok) {