Optimizacion simple
This commit is contained in:
@ -131,9 +131,9 @@
|
|||||||
chunks.push(units.data.units.slice(i, i + chunkSize).map(u => u.id))
|
chunks.push(units.data.units.slice(i, i + chunkSize).map(u => u.id))
|
||||||
}
|
}
|
||||||
const promises = []
|
const promises = []
|
||||||
|
const url = `{{ $urls->api }}/proyectos/broker/{{ $contract->broker->rut }}/contract/{{ $contract->id }}/promotions`
|
||||||
|
const method = 'post'
|
||||||
chunks.forEach(chunk => {
|
chunks.forEach(chunk => {
|
||||||
const url = `{{ $urls->api }}/proyectos/broker/{{ $contract->broker->rut }}/contract/{{ $contract->id }}/promotions`
|
|
||||||
const method = 'post'
|
|
||||||
const body = new FormData()
|
const body = new FormData()
|
||||||
chunk.forEach(id => body.append('unidad_ids[]', id))
|
chunk.forEach(id => body.append('unidad_ids[]', id))
|
||||||
promises.push(APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
|
promises.push(APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
|
||||||
@ -155,9 +155,9 @@
|
|||||||
chunks.push(units.data.units.slice(i, i + chunkSize).map(u => u.id))
|
chunks.push(units.data.units.slice(i, i + chunkSize).map(u => u.id))
|
||||||
}
|
}
|
||||||
const promises = []
|
const promises = []
|
||||||
|
const url = `{{ $urls->api }}/proyecto/{{ $contract->project->id }}/unidades/precios`
|
||||||
|
const method = 'post'
|
||||||
chunks.forEach(chunk => {
|
chunks.forEach(chunk => {
|
||||||
const url = `{{ $urls->api }}/proyecto/{{ $contract->project->id }}/unidades/precios`
|
|
||||||
const method = 'post'
|
|
||||||
const body = new FormData()
|
const body = new FormData()
|
||||||
chunk.forEach(id => body.append('unidad_ids[]', id))
|
chunk.forEach(id => body.append('unidad_ids[]', id))
|
||||||
promises.push(APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
|
promises.push(APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
|
||||||
|
Reference in New Issue
Block a user