-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimportarNomivac.ts
More file actions
28 lines (26 loc) · 935 Bytes
/
importarNomivac.ts
File metadata and controls
28 lines (26 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { servicioMongo } from './servicioMongo';
import { servicioSips } from './servicioSips'
var srvSips = new servicioSips();
var srvMongo = new servicioMongo();
// buscar el maximo id mongo para pasarlo como parametro en el otro llamado
srvSips.obtenerDatosNomivac(1, 2)
.then((resultado) => {
if (resultado == null) {
console.log('Sin datos Nomivac');
} else {
var listaVacunas;
listaVacunas = resultado[0];
//console.log(listaVacunas);
//srvMongo.borrarCollection('nomivac');
srvMongo.guardarNomivac(listaVacunas, 'nomivac')
.then((res => {
console.log('Guardar Vacunas');
}))
.catch((err => {
console.log('Error al guardar Vacunas', err);
}))
}
})
.catch((err) => {
console.error('Error**:' + err)
});