.
This commit is contained in:
@@ -22,12 +22,12 @@ const post = async(req, res) => {
|
||||
data.shift();
|
||||
for (row of data) {
|
||||
if (row[1]) {
|
||||
var activoFijo = await ActivoFijo.findOrCreate({
|
||||
var activoFijo = await ActivoFijo.findOne({
|
||||
where: {
|
||||
activoFijo: row[1] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((res) => console.log(res));
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[3]) {
|
||||
@@ -49,7 +49,7 @@ const post = async(req, res) => {
|
||||
}
|
||||
|
||||
if (row[14]) {
|
||||
var uResponsable = await UResponsable.findOrCreate({
|
||||
var uResponsable = await UResponsable.findOne({
|
||||
where: {
|
||||
uResponsable: row[14] || 'No declarado'
|
||||
}
|
||||
@@ -77,7 +77,7 @@ const post = async(req, res) => {
|
||||
|
||||
let equipo = {
|
||||
noInventario: row[0],
|
||||
idActivoFijo: activoFijo[0]['idActivoFijo'],
|
||||
idActivoFijo: activoFijo.dataValues.idActivoFijo,
|
||||
modelo: row[2],
|
||||
marca: marca[0]['idMarca'],
|
||||
noSerie: row[4],
|
||||
@@ -90,7 +90,7 @@ const post = async(req, res) => {
|
||||
graficos: row[11],
|
||||
osname: os[0]['idOS'],
|
||||
noResguardo: row[13],
|
||||
uResponsable: uResponsable[0]['idUnidadResponsable'],
|
||||
uResponsable: uResponsable.dataValues.idUnidadResponsable,
|
||||
ubicacion: ubicacion[0]['idUbicacion'],
|
||||
uso: uso[0]['idUso']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user