Skip to content

Commit 02b5952

Browse files
committed
Fixes failure to submit feedback
1 parent 4407fe5 commit 02b5952

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@
353353
showViewMoreRecommendations: false,
354354
otherRecommendationsLoaded: false,
355355
recommendationsEvent: null,
356+
recommendationsInteractionEvent: null,
356357
feedbackReason: [],
357358
showFeedbackModal: false,
358359
otherFeedback: '',
@@ -361,6 +362,7 @@
361362
previewedNodeIds: [],
362363
rejectedNode: null,
363364
showFeedbackErrorMessage: false,
365+
interactionEventsIdMap: {},
364366
};
365367
},
366368
computed: {
@@ -784,7 +786,7 @@
784786
this.rejectedNode = node;
785787
const type = FeedbackTypeOptions.rejected;
786788
const reason = this.recommendationsFeedback ? this.recommendationsFeedback : type;
787-
const interactionEvent = new RecommendationsInteractionEvent({
789+
this.recommendationsInteractionEvent = new RecommendationsInteractionEvent({
788790
recommendation_event_id: this.recommendationsEvent.id,
789791
contentnode_id: node.id,
790792
content_id: node.content_id,
@@ -794,8 +796,9 @@
794796
feedback_type: type,
795797
feedback_reason: reason,
796798
});
797-
sendRequest(interactionEvent)
798-
.then(() => {
799+
sendRequest(this.recommendationsInteractionEvent)
800+
.then(response => {
801+
this.interactionEventsIdMap[this.recommendationsInteractionEvent.id] = response?.id;
799802
this.rejectedNodeIds.push(node.id);
800803
this.showSnackbar({
801804
text: this.feedbackConfirmationMessage$(),
@@ -830,6 +833,7 @@
830833
submitRejectedRecommendationFeedback() {
831834
const rejectedEvent = new RecommendationsInteractionEvent({
832835
method: 'patch',
836+
id: this.interactionEventsIdMap[this.recommendationsInteractionEvent.id],
833837
recommendation_event_id: this.recommendationsEvent.id,
834838
contentnode_id: this.rejectedNode.id,
835839
content_id: this.rejectedNode.content_id,

0 commit comments

Comments
 (0)