@capillarytech/creatives-library 7.12.27 → 7.12.28

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.12.27",
4
+ "version": "7.12.28",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -8,6 +8,7 @@ import {
8
8
  CREATE_TRAI_SMS_TEMPLATE_REQUEST,
9
9
  CLEAR_TRAI_SMS_TEMPLATE_CREATE_RESPONSE_REQUEST,
10
10
  CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
11
+ CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
11
12
  } from './constants';
12
13
 
13
14
  export function createSMSTRAITemplates(templates, callback) {
@@ -29,4 +30,11 @@ export function checkDuplicatesInDb(payload) {
29
30
  type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
30
31
  payload,
31
32
  };
32
- }
33
+ }
34
+
35
+ export function doneCheckingDuplicates(data) {
36
+ return {
37
+ type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
38
+ data,
39
+ };
40
+ }
@@ -428,7 +428,15 @@ export const SmsTraiCreate = (props) => {
428
428
  setUploadValidated(true);
429
429
  setValidatedData(transformedResults);
430
430
  setTemplateRegistrationIndex(templateIdIndex);
431
- actions.checkDuplicatesInDb(checkInDb);
431
+ if (checkInDb.length > 0) {
432
+ actions.checkDuplicatesInDb(checkInDb);
433
+ } else {
434
+ const data = {
435
+ templateId: [],
436
+ count: 0,
437
+ }
438
+ actions.doneCheckingDuplicates(data);
439
+ }
432
440
  };
433
441
 
434
442
  const checkDuplicateTemplateNameInCSV = (