FIX: Editar datos Broker

This commit is contained in:
Juan Pablo Vial
2025-03-12 18:31:21 -03:00
parent 7c7c8315e2
commit 8b04eb262f
4 changed files with 37 additions and 4 deletions

View File

@ -168,7 +168,20 @@
window.location.reload()
})
},
edit: (broker_rut, data) => {},
edit: data => {
const url = '{{$urls->api}}/proyectos/brokers/edit'
const method = 'post'
const body = new FormData()
body.append('brokers[]', JSON.stringify(data))
return APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
if (!json.success) {
console.error(json.errors)
alert('No se pudo editar operador.')
return
}
window.location.reload()
})
},
delete: broker_rut => {
const url = '{{$urls->api}}/proyectos/broker/' + broker_rut
const method = 'delete'