Commit 79f1a7b27af451faf2b85f88824d7b238fad8575

Authored by Nattapon Wongpaet
1 parent 6b59edcf
Exists in master and in 1 other branch dev

update api get vizcard

ais-structure/src/modules/vizcard/vizCard.ctrl.js
@@ -45,7 +45,11 @@ exports.vizcard = async function (req, res, next) { @@ -45,7 +45,11 @@ exports.vizcard = async function (req, res, next) {
45 Password : "1234", 45 Password : "1234",
46 SystemName : "30", 46 SystemName : "30",
47 QueryType : "1", 47 QueryType : "1",
48 - CardId : req.params.id 48 + CardId : req.query.commandId,
  49 + firstName : req.query.firstName,
  50 + lastName : req.query.lastName,
  51 + emailAddress : req.query.emailAddress,
  52 + moblieNo : req.query.moblieNo
49 }; 53 };
50 54
51 var soap = messageSOAP.objectToSOAP(objectData,"SearchCustomer") 55 var soap = messageSOAP.objectToSOAP(objectData,"SearchCustomer")
@@ -63,7 +67,7 @@ exports.vizcard = async function (req, res, next) { @@ -63,7 +67,7 @@ exports.vizcard = async function (req, res, next) {
63 // parseString(result.body, function (err, result1) { 67 // parseString(result.body, function (err, result1) {
64 // console.log(result1); 68 // console.log(result1);
65 // }); 69 // });
66 - 70 +
67 var resultSoap = parseJson.xml2json(result.body, {compact: true, spaces: 4}) 71 var resultSoap = parseJson.xml2json(result.body, {compact: true, spaces: 4})
68 resultSoap = JSON.parse(resultSoap) 72 resultSoap = JSON.parse(resultSoap)
69 resultSoap = resultSoap['soap:Envelope']['soap:Body']['tem:SearchCustomerResponse']['tem:SearchCustomerResult']['tem:CustomerSearchResult']; 73 resultSoap = resultSoap['soap:Envelope']['soap:Body']['tem:SearchCustomerResponse']['tem:SearchCustomerResult']['tem:CustomerSearchResult'];
ais-structure/src/modules/vizcard/vizCard.route.js
@@ -2,7 +2,7 @@ module.exports = function (app) { @@ -2,7 +2,7 @@ module.exports = function (app) {
2 var vizcardCtrl = app.modules.vizcard.vizCardCtrl; 2 var vizcardCtrl = app.modules.vizcard.vizCardCtrl;
3 var postVizcardCtrl = app.modules.vizcard.postVizCardCtrl; 3 var postVizcardCtrl = app.modules.vizcard.postVizCardCtrl;
4 4
5 - app.get('/cmf/v2/vizCard/:id.json', 5 + app.get('/cmf/v2/vizcard.json',
6 vizcardCtrl.vizcard 6 vizcardCtrl.vizcard
7 ); 7 );
8 8