diff --git a/src/api/appType/whatsapp_cloud/index.js b/src/api/appType/whatsapp_cloud/index.js index 384d3841..4fa57673 100644 --- a/src/api/appType/whatsapp_cloud/index.js +++ b/src/api/appType/whatsapp_cloud/index.js @@ -2,6 +2,8 @@ import qs from 'query-string'; import request from '@/api/request.js'; const resource = '/api/v1/apptypes/wpp-cloud/apps'; +const catalogsResource = '/api/v1/apptypes/wpp-cloud'; + export default { getDebugToken(params) { const queryString = qs.stringify(params); @@ -14,4 +16,25 @@ export default { configurePhoneNumber(data) { return request.$http.post(`${resource}/`, data); }, + getWhatsAppCloudCatalogs(appUuid) { + return request.$http.get(`${catalogsResource}/${appUuid}/catalogs/`); + }, + fetchCatalogData(appUuid, catalogUuid) { + return request.$http.get(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/`); + }, + disableWhatsAppCloudCatalogs(appUuid, catalogUuid) { + return request.$http.post(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/disable/`); + }, + enableWhatsAppCloudCatalogs(appUuid, catalogUuid) { + return request.$http.post(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/enable/`); + }, + toggleCartVisibility(appUuid, data) { + return request.$http.post(`${catalogsResource}/${appUuid}/toggle-cart-visibility/`, data); + }, + toggleCatalogVisibility(appUuid, data) { + return request.$http.post(`${catalogsResource}/${appUuid}/toggle-catalog-visibility/`, data); + }, + getCommerceSettings(appUuid) { + return request.$http.get(`${catalogsResource}/${appUuid}/commerce-settings/`); + }, }; diff --git a/src/components/config/channels/whatsapp/Setup.vue b/src/components/config/channels/whatsapp/Setup.vue index 4f03de41..6c61e65d 100644 --- a/src/components/config/channels/whatsapp/Setup.vue +++ b/src/components/config/channels/whatsapp/Setup.vue @@ -173,7 +173,8 @@ }, { return_scopes: true, - scope: 'business_management,whatsapp_business_management,whatsapp_business_messaging', + scope: + 'business_management,whatsapp_business_management,whatsapp_business_messaging,catalog_management', extras: { feature: 'whatsapp_embedded_signup', }, diff --git a/src/components/config/channels/whatsapp/components/tabs/AccountTab.vue b/src/components/config/channels/whatsapp/components/tabs/AccountTab.vue index 5e235e6f..4ee81fa1 100644 --- a/src/components/config/channels/whatsapp/components/tabs/AccountTab.vue +++ b/src/components/config/channels/whatsapp/components/tabs/AccountTab.vue @@ -3,18 +3,35 @@