@capillarytech/creatives-library 8.0.87-alpha.18 → 8.0.87-alpha.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/services/api.js +4 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.87-alpha.18",
4
+ "version": "8.0.87-alpha.19",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -118,7 +118,7 @@ function request(url, options, handleUnauthorizedStatus) {
118
118
  .catch((error) => error);
119
119
  }
120
120
 
121
- function getAPICallObject(method, body, isFileUpload = false, loadCampaignHeaders = false, orgUnitId = false) {
121
+ function getAPICallObject(method, body, isFileUpload = false, loadCampaignHeaders = false, orgUnitId = false, allowOrgInProd = false) {
122
122
  const token = loadItem('token');
123
123
  const orgID = loadItem('orgID');
124
124
  const user = loadItem('user');
@@ -145,8 +145,8 @@ function getAPICallObject(method, body, isFileUpload = false, loadCampaignHeader
145
145
  headers['X-CAP-REMOTE-USER'] = user.refID;
146
146
  }
147
147
 
148
- if (process.env.NODE_ENV !== 'production' && orgID !== undefined) {
149
- headers['X-CAP-API-AUTH-ORG-ID'] = orgID;
148
+ if ((allowOrgInProd || process.env.NODE_ENV !== "production") && orgID !== undefined) {
149
+ headers["X-CAP-API-AUTH-ORG-ID"] = orgID;
150
150
  }
151
151
 
152
152
  if (process.env.NODE_ENV !== 'production' && token !== undefined) {
@@ -571,7 +571,7 @@ export const getLiquidTags = (content) => {
571
571
 
572
572
  export const createCentralCommsMetaId = (payload, metaId = 'TRANSACTION') => {
573
573
  const url = `${API_ENDPOINT}/common/central-comms/meta-id/${metaId}`;
574
- return request(url, getAPICallObject('POST', payload));
574
+ return request(url, getAPICallObject('POST', payload, false, false, false, true));
575
575
  };
576
576
 
577
577
  export {request, getAPICallObject};