|
353 | 353 | showViewMoreRecommendations: false,
|
354 | 354 | otherRecommendationsLoaded: false,
|
355 | 355 | recommendationsEvent: null,
|
| 356 | + recommendationsInteractionEvent: null, |
356 | 357 | feedbackReason: [],
|
357 | 358 | showFeedbackModal: false,
|
358 | 359 | otherFeedback: '',
|
|
361 | 362 | previewedNodeIds: [],
|
362 | 363 | rejectedNode: null,
|
363 | 364 | showFeedbackErrorMessage: false,
|
| 365 | + interactionEventsIdMap: {}, |
364 | 366 | };
|
365 | 367 | },
|
366 | 368 | computed: {
|
|
784 | 786 | this.rejectedNode = node;
|
785 | 787 | const type = FeedbackTypeOptions.rejected;
|
786 | 788 | const reason = this.recommendationsFeedback ? this.recommendationsFeedback : type;
|
787 |
| - const interactionEvent = new RecommendationsInteractionEvent({ |
| 789 | + this.recommendationsInteractionEvent = new RecommendationsInteractionEvent({ |
788 | 790 | recommendation_event_id: this.recommendationsEvent.id,
|
789 | 791 | contentnode_id: node.id,
|
790 | 792 | content_id: node.content_id,
|
|
794 | 796 | feedback_type: type,
|
795 | 797 | feedback_reason: reason,
|
796 | 798 | });
|
797 |
| - sendRequest(interactionEvent) |
798 |
| - .then(() => { |
| 799 | + sendRequest(this.recommendationsInteractionEvent) |
| 800 | + .then(response => { |
| 801 | + this.interactionEventsIdMap[this.recommendationsInteractionEvent.id] = response?.id; |
799 | 802 | this.rejectedNodeIds.push(node.id);
|
800 | 803 | this.showSnackbar({
|
801 | 804 | text: this.feedbackConfirmationMessage$(),
|
|
830 | 833 | submitRejectedRecommendationFeedback() {
|
831 | 834 | const rejectedEvent = new RecommendationsInteractionEvent({
|
832 | 835 | method: 'patch',
|
| 836 | + id: this.interactionEventsIdMap[this.recommendationsInteractionEvent.id], |
833 | 837 | recommendation_event_id: this.recommendationsEvent.id,
|
834 | 838 | contentnode_id: this.rejectedNode.id,
|
835 | 839 | content_id: this.rejectedNode.content_id,
|
|
0 commit comments