diff --git a/app/controllers/api/v1/widget/messages_controller.rb b/app/controllers/api/v1/widget/messages_controller.rb index 991b2f428..c5492eff9 100644 --- a/app/controllers/api/v1/widget/messages_controller.rb +++ b/app/controllers/api/v1/widget/messages_controller.rb @@ -54,7 +54,7 @@ class Api::V1::Widget::MessagesController < Api::V1::Widget::BaseController end def message_update_params - params.permit(message: [{ submitted_values: [:name, :title, :value] }]) + params.permit(message: [{ submitted_values: [:name, :title, :value, { csat_survey_response: [:feedback_text, :rating] }] }]) end def permitted_params diff --git a/app/javascript/shared/components/CustomerSatisfaction.vue b/app/javascript/shared/components/CustomerSatisfaction.vue index 3a346be18..4a49e8c89 100644 --- a/app/javascript/shared/components/CustomerSatisfaction.vue +++ b/app/javascript/shared/components/CustomerSatisfaction.vue @@ -1,21 +1,20 @@ @@ -121,6 +125,17 @@ export default { messageId: this.messageId, }); }, + onCSATSubmit({ feedback, rating }) { + this.onResponse({ + submittedValues: { + csat_survey_response: { + rating, + feedback_text: feedback, + }, + }, + messageId: this.messageId, + }); + }, }, }; diff --git a/app/javascript/widget/i18n/locale/en.json b/app/javascript/widget/i18n/locale/en.json index 3cbcd6020..dd114afff 100644 --- a/app/javascript/widget/i18n/locale/en.json +++ b/app/javascript/widget/i18n/locale/en.json @@ -59,6 +59,7 @@ }, "CSAT": { "TITLE": "Rate your conversation", + "SUBMITTED_TITLE": "Thank you for submitting the rating", "PLACEHOLDER": "Tell us more..." } }