Skip to content

Commit

Permalink
Merge pull request #16 from TourConnect/fix/remarks_special_char
Browse files Browse the repository at this point in the history
Fix/remarks special char, fix product name matching
  • Loading branch information
shintre authored Aug 16, 2024
2 parents 57d0b29 + f2b0d14 commit 2c85280
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Normalizer = require('./normalizer');

const xmlParser = new xml2js.Parser();
const fastParser = new XMLParser();
const BAD_XML_CHARS = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007f-\u0084\u0086-\u009f\uD800-\uDFFF\uFDD0-\uFDFF\uFFFF\uC008\uFEFF]/g;

const defaultXmlOptions = {
prettyPrinting: { enabled: false },
Expand Down Expand Up @@ -210,6 +211,7 @@ class Plugin {
Twin: 'TW',
Triple: 'TR',
Quad: 'QD',
Other: 'OT',
})[roomType];
if (RoomType) RoomConfig.RoomType = RoomType;
if (passengers && passengers.length && !noPaxList) {
Expand Down Expand Up @@ -253,6 +255,7 @@ class Plugin {
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(BAD_XML_CHARS, '')
};

// this.errorPathsAxiosErrors = () => ([ // axios triggered errors
Expand Down
3 changes: 2 additions & 1 deletion resolvers/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const translateTCMLCollection = async ({ rootValue, typeDefs, query }) => {

const translateTPOption = ({ optionsGroupedBySupplierId, supplierData }) => {
return {
productId: supplierData.supplierId,
// LLM sends the product id as string
productId: supplierData.supplierId + "",
productName: supplierData.supplierName,
address: supplierData.supplierAddress,
serviceTypes: supplierData.serviceTypes,
Expand Down

0 comments on commit 2c85280

Please sign in to comment.