Skip date if none provided
This commit is contained in:
@ -115,7 +115,7 @@
|
||||
this.data.filename = 'Plantilla de Precios'
|
||||
this.data.format = 'xlsx'
|
||||
this.data.columns = {
|
||||
Fecha: '',
|
||||
'Fecha*': 'Fecha es opcional. Se toma la fecha seleccionada',
|
||||
'Proyecto*': 'Proyecto es opcional. Se toma el proyecto seleccionado',
|
||||
'Tipo*': 'Tipo es optional. Se toma departamento.',
|
||||
Unidad: '',
|
||||
@ -181,7 +181,9 @@
|
||||
const body = new FormData()
|
||||
body.set('project_id', this.components.project.value)
|
||||
const date = this.components.$calendar.calendar('get date')
|
||||
body.set('date', [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-'))
|
||||
if (date) {
|
||||
body.set('date', [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-'))
|
||||
}
|
||||
body.set('file', this.components.file.files[0])
|
||||
APIClient.fetch(url, {method, body}).then(response => response.json()).then(json => {
|
||||
if (json.status === true) {
|
||||
|
||||
Reference in New Issue
Block a user