fpavon-ee-shared 1.0.36 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,13 +14,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.NotificacionController = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const http_1 = __importDefault(require("http"));
|
|
17
18
|
const notificacion_class_1 = require("../domain/notificacion.class");
|
|
18
19
|
class NotificacionController {
|
|
19
20
|
constructor() {
|
|
20
21
|
this.guardarNotificacion = (unidadEmisora, unidadReceptora, info, usuario, icono, codigoInterno) => __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
try {
|
|
22
23
|
let notificacion = new notificacion_class_1.Notificacion(unidadEmisora, unidadReceptora, info, usuario, icono, codigoInterno);
|
|
23
|
-
|
|
24
|
+
const dataJson = JSON.stringify(notificacion);
|
|
25
|
+
const config = {
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json'
|
|
28
|
+
},
|
|
29
|
+
httpAgent: new http_1.default.Agent({ keepAlive: true }),
|
|
30
|
+
};
|
|
31
|
+
const url_servicio = `${process.env.URL_SERVE}/notificaciones/guardar`;
|
|
32
|
+
yield axios_1.default.post(url_servicio, dataJson, config);
|
|
24
33
|
}
|
|
25
34
|
catch (error) {
|
|
26
35
|
console.error("Error NotificacionesController.guardarNotificacion=>", error);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import http from 'http';
|
|
2
3
|
import { Notificacion } from "../domain/notificacion.class"
|
|
3
4
|
|
|
4
5
|
export class NotificacionController{
|
|
@@ -8,7 +9,19 @@ export class NotificacionController{
|
|
|
8
9
|
guardarNotificacion = async(unidadEmisora,unidadReceptora, info, usuario, icono, codigoInterno?) => {
|
|
9
10
|
try {
|
|
10
11
|
let notificacion = new Notificacion(unidadEmisora,unidadReceptora, info, usuario, icono, codigoInterno);
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
const dataJson = JSON.stringify(notificacion);
|
|
14
|
+
|
|
15
|
+
const config = {
|
|
16
|
+
headers: {
|
|
17
|
+
'Content-Type': 'application/json'
|
|
18
|
+
},
|
|
19
|
+
httpAgent: new http.Agent({ keepAlive: true }),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const url_servicio = `${process.env.URL_SERVE}/notificaciones/guardar`;
|
|
23
|
+
|
|
24
|
+
await axios.post(url_servicio, dataJson, config);
|
|
12
25
|
} catch (error:any) {
|
|
13
26
|
console.error("Error NotificacionesController.guardarNotificacion=>", error);
|
|
14
27
|
}
|