@capillarytech/creatives-library 8.0.150 → 8.0.151
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/index.js +1 -0
- package/package.json +1 -1
- package/services/api.js +5 -0
- package/services/tests/api.test.js +18 -0
package/index.js
CHANGED
|
@@ -146,6 +146,7 @@ export {default as EmailMobilePreview} from './v2Components/EmailMobilePreview';
|
|
|
146
146
|
export {default as MobilePushPreview} from './v2Components/MobilePushPreviewV2';
|
|
147
147
|
export {default as WechatRichmediaTemplatePreview} from './v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
148
148
|
export {default as FTP} from './v2Containers/FTP';
|
|
149
|
+
export {default as updateMetaConfig} from './services/api';
|
|
149
150
|
|
|
150
151
|
CreativesContainer.CreativesContainerReducer = CreativesContainerReducer;
|
|
151
152
|
|
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -637,6 +637,11 @@ export const createCentralCommsMetaId = (payload, metaType = TRANSACTION) => {
|
|
|
637
637
|
return request(url, getAPICallObject('POST', payload, false, false, false, true));
|
|
638
638
|
};
|
|
639
639
|
|
|
640
|
+
export const updateMetaConfig = (payload, metaType = TRANSACTION, metaId) => {
|
|
641
|
+
const url = `${API_ENDPOINT}/common/central-comms/meta-id/${metaType}/${metaId}`;
|
|
642
|
+
return request(url, getAPICallObject('PATCH', payload, false, false, false, true));
|
|
643
|
+
};
|
|
644
|
+
|
|
640
645
|
// Customer Search APIs for Email Test & Preview Feature
|
|
641
646
|
export const searchCustomers = ({ query }) => {
|
|
642
647
|
const url = `${MEMBERCARE_API_ENDPOINT}/customers/search?q=${encodeURIComponent(query)}&limit=10`;
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
getBulkCustomerDetails,
|
|
24
24
|
createTestMessageMeta,
|
|
25
25
|
updateTestMessageMeta,
|
|
26
|
+
updateMetaConfig,
|
|
26
27
|
} from '../api';
|
|
27
28
|
import { mockData } from './mockData';
|
|
28
29
|
import getSchema from '../getSchema';
|
|
@@ -804,3 +805,20 @@ describe('updateTestMessageMeta', () => {
|
|
|
804
805
|
});
|
|
805
806
|
});
|
|
806
807
|
});
|
|
808
|
+
|
|
809
|
+
describe('updateMetaConfig', () => {
|
|
810
|
+
it('should return correct response', async () => {
|
|
811
|
+
global.fetch.mockReturnValue(Promise.resolve({
|
|
812
|
+
status: 200,
|
|
813
|
+
json: () => Promise.resolve({
|
|
814
|
+
status: 200,
|
|
815
|
+
response: 'test',
|
|
816
|
+
}),
|
|
817
|
+
}));
|
|
818
|
+
const result = await updateMetaConfig({ query: 'test' });
|
|
819
|
+
expect(result).toEqual({
|
|
820
|
+
status: 200,
|
|
821
|
+
response: 'test',
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
});
|