@capillarytech/creatives-library 7.10.14 → 7.10.16
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.
package/package.json
CHANGED
|
@@ -113,8 +113,9 @@ export const SmsTraiCreate = (props) => {
|
|
|
113
113
|
|
|
114
114
|
const templateIdValidation = (templateId) => {
|
|
115
115
|
let isError = false;
|
|
116
|
+
const _templateId = templateId?.replace(/[“”"'‘’`´]/g, '');
|
|
116
117
|
const numbersOnly = /^\d+$/;
|
|
117
|
-
if (
|
|
118
|
+
if (!numbersOnly.test(_templateId)) {
|
|
118
119
|
isError = true;
|
|
119
120
|
}
|
|
120
121
|
return isError;
|
|
@@ -154,7 +155,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
154
155
|
columnErrorArray.push(`Only Templates with active status will be created.`);
|
|
155
156
|
} else if (index === templateIdIndex && templateIdValidation(cell)) {
|
|
156
157
|
columnErrorArray.push(
|
|
157
|
-
`${selectedTemplateIdAlias.toUpperCase()} is mandatory and ${selectedTemplateIdAlias.toUpperCase()} must
|
|
158
|
+
`${selectedTemplateIdAlias.toUpperCase()} is mandatory and ${selectedTemplateIdAlias.toUpperCase()} must be numeric.`,
|
|
158
159
|
);
|
|
159
160
|
} else if (!cell && ![headerIndex, approvalIndex, templateIdIndex, statusIndex].includes(index)) {
|
|
160
161
|
errorArray.push(`"${transformedResults[0][index]}"`);
|
|
@@ -475,6 +476,8 @@ export const SmsTraiCreate = (props) => {
|
|
|
475
476
|
arr.forEach((data, i) => {
|
|
476
477
|
obj[transformedResults[0][i]] = arr[i];
|
|
477
478
|
});
|
|
479
|
+
//removing additional single/double quotes from template_id
|
|
480
|
+
obj['template_id'] = obj['template_id']?.replace(/[“”"'‘’`´]/g, '');
|
|
478
481
|
obj['unicode-validity'] = true;
|
|
479
482
|
obj['updated-sms-editor'] = '';
|
|
480
483
|
obj['var-mapped'] = {};
|