Skip to content

Commit

Permalink
Merge tag '2.0.1-rc.21-staging' of https://github.com/weni-ai/weni-in…
Browse files Browse the repository at this point in the history
…tegrations-webapp into fix/profilewpp
  • Loading branch information
acnormun committed Jun 11, 2024
2 parents 8682ec6 + 8e5117f commit 2703727
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
9 changes: 4 additions & 5 deletions src/api/appType/whatsapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export default {
deleteTemplateMessage(appUuid, templateUuid) {
return request.$http.delete(`${templatesResource}/${appUuid}/templates/${templateUuid}`);
},
createTemplateTranslation(appUuid, templateUuid, data) {
return request.$http.post(
`${templatesResource}/${appUuid}/templates/${templateUuid}/translations/`,
data,
);
async createTemplateTranslation(appUuid, templateUuid, data) {
return await request.$http
.post(`${templatesResource}/${appUuid}/templates/${templateUuid}/translations/`, data)
.then((r) => r.data);
},
updateTemplateTranslation(appUuid, templateUuid, data) {
return request.$http.patch(`${templatesResource}/${appUuid}/templates/${templateUuid}/`, data);
Expand Down
11 changes: 7 additions & 4 deletions src/components/whatsAppTemplates/FormTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,10 @@
await this.createTemplate({ appUuid, payload: templatePayload });
if (this.errorCreateTemplate) {
this.callErrorModal({ text: this.$t('WhatsApp.templates.error.create_template') });
this.loadingSave = false;
return;
}
currentTemplateUuid = this.createdTemplateData.uuid;
this.loadingSave = false;
}
const translationPayload = this.buildPayload();
Expand All @@ -384,7 +383,6 @@
translationPayload,
});
}
this.loadingSave = false;
},
async createTranslation({ currentTemplateUuid, translationPayload }) {
Expand All @@ -396,7 +394,10 @@
});
if (this.errorCreateTemplateTranslation) {
this.callErrorModal({ text: this.$t('WhatsApp.templates.error.create_translation') });
const errorText =
this.errorCreateTemplateTranslation?.error_user_msg ||
this.$t('WhatsApp.templates.error.create_translation');
this.callErrorModal({ text: errorText });
} else {
this.callSuccessModal({ text: this.$t('WhatsApp.templates.success.create_translation') });
}
Expand Down Expand Up @@ -717,9 +718,11 @@
::-webkit-scrollbar {
height: $unnnic-border-width-thick;
}
::-webkit-scrollbar-track {
background: $unnnic-color-neutral-soft;
}
::-webkit-scrollbar-thumb {
background: $unnnic-color-neutral-clean;
border-radius: $unnnic-border-radius-md;
Expand Down
8 changes: 4 additions & 4 deletions src/store/appType/channels/whatsapp/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ export default {
async updateWppProfile({ commit }, { code, appUuid, payload }) {
commit('UPDATE_WHATSAPP_PROFILE_REQUEST');
try {
const { data } = await whatsApp.updateWppProfile(code, appUuid, payload);
const data = await whatsApp.updateWppProfile(code, appUuid, payload);
commit('UPDATE_WHATSAPP_PROFILE_SUCCESS', data);
} catch (err) {
captureSentryException(err);
commit('UPDATE_WHATSAPP_PROFILE_ERROR', err);
}
},
Expand Down Expand Up @@ -141,11 +140,12 @@ export default {
async createTemplateTranslation({ commit }, { appUuid, templateUuid, payload }) {
commit('CREATE_TEMPLATE_TRANSLATION_REQUEST');
try {
const { data } = await whatsApp.createTemplateTranslation(appUuid, templateUuid, payload);
const data = await whatsApp.createTemplateTranslation(appUuid, templateUuid, payload);
commit('CREATE_TEMPLATE_TRANSLATION_SUCCESS', data);
} catch (err) {
captureSentryException(err);
commit('CREATE_TEMPLATE_TRANSLATION_ERROR', err);
const error = err.response?.data?.error;
commit('CREATE_TEMPLATE_TRANSLATION_ERROR', error || err);
}
},

Expand Down

0 comments on commit 2703727

Please sign in to comment.