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 45 Password : "1234",
46 46 SystemName : "30",
47 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 55 var soap = messageSOAP.objectToSOAP(objectData,"SearchCustomer")
... ... @@ -63,7 +67,7 @@ exports.vizcard = async function (req, res, next) {
63 67 // parseString(result.body, function (err, result1) {
64 68 // console.log(result1);
65 69 // });
66   -
  70 +
67 71 var resultSoap = parseJson.xml2json(result.body, {compact: true, spaces: 4})
68 72 resultSoap = JSON.parse(resultSoap)
69 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 2 var vizcardCtrl = app.modules.vizcard.vizCardCtrl;
3 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 6 vizcardCtrl.vizcard
7 7 );
8 8  
... ...