Cambiada ruta de petición al desactivar cliente.

This commit is contained in:
Joan Sanchez 2017-11-20 18:56:53 +01:00
parent 96f1db5cb7
commit a138554301
3 changed files with 8 additions and 8 deletions

View File

@ -42,10 +42,10 @@ module.exports = function(Client) {
let currentDate = new Date();
if (data && client.active && (data.ended >= currentDate || data.ended == null)) {
let host = ctx.req.headers.host.split(':')[0];
if (data && client.active && (data.ended >= currentDate || data.ended == null)) {
let referer = ctx.req.headers.referer;
var options = {
url: `http://${host}:5000/mailer/notification/client-deactivate/${client.id}`,
url: `${referer}/mailer/notification/client-deactivate/${client.id}`,
method: 'POST',
headers: {
'content-type': 'application/json',

View File

@ -55,7 +55,7 @@ router.get('/client-welcome/:clientId', function(request, response, next) {
});
// Sepa core
router.post('/sepa-core/:clientId', function(request, response, next) {
/* router.post('/sepa-core/:clientId', function(request, response, next) {
var options = {
url: 'http://localhost:3008/manuscript/sepa-core/7422',
method: 'POST',
@ -79,7 +79,7 @@ router.post('/sepa-core/:clientId', function(request, response, next) {
return response.status(400).json({message: error.message});
return response.json();
}); */
});
});
}); */
module.exports = router;

View File

@ -64,10 +64,10 @@ var settings = require('../settings.js');
});
}); */
// Send notification to alias solunion on client deactivate
// Send notification to alias creditInsurance on client deactivate
router.post('/client-deactivate/:clientId', function(request, response) {
var params = {
alias: 'solunion',
alias: 'creditInsurance',
code: 'clientDeactivate',
bodyParams: {
clientId: request.params.clientId