FIX: Editar datos Broker
This commit is contained in:
@ -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'
|
||||
|
Reference in New Issue
Block a user