Skip to content

Commit 308d4f2

Browse files
committed
add remaining recommendation classes in the frontend utilities
1 parent 2ed4952 commit 308d4f2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

contentcuration/contentcuration/frontend/shared/feedbackApiUtils.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const FeedbackTypeOptions = {
1616
// This is mock currently, fixed value of URL still to be decided
1717
// referencing the url by name
1818
export const FLAG_FEEDBACK_EVENT_URL = urls[`${'flagged'}_${'list'}`];
19+
const RECCOMMENDATION_EVENT_URL = 'TBD';
20+
const RECCOMMENDATION_INTERACTION_EVENT_URL = 'TBD';
1921

2022
/**
2123
* @typedef {Object} BaseFeedbackParams
@@ -133,6 +135,35 @@ export class FlagFeedbackEvent extends BaseFlagFeedback {
133135
}
134136
}
135137

138+
/**
139+
* Initializes a new RecommendationsEvent object.
140+
*
141+
* @param {Object} params - Parameters for initializing the recommendations event.
142+
* @param {Object[]} params.content - An array of JSON objects,
143+
* each representing a recommended content item.
144+
*/
145+
export class RecommendationsEvent extends BaseFeedbackEvent {
146+
constructor({ content, ...basefeedbackEventParams }) {
147+
super(basefeedbackEventParams);
148+
this.content = content;
149+
this.URL = RECCOMMENDATION_EVENT_URL;
150+
}
151+
}
152+
153+
/**
154+
* Initializes a new RecommendationsInteractionEvent object.
155+
*
156+
* @param {Object} params - Parameters for initializing the recommendations interaction event.
157+
* @param {BaseFeedbackParams} feedbackInteractionEventParams - Parameters inherited from the
158+
* base feedback interaction event class.
159+
*/
160+
export class RecommendationsInteractionEvent extends BaseFeedbackInteractionEvent {
161+
constructor(feedbackInteractionEventParams) {
162+
super(feedbackInteractionEventParams);
163+
this.URL = RECCOMMENDATION_INTERACTION_EVENT_URL;
164+
}
165+
}
166+
136167
/**
137168
* Sends a request using the provided feedback object.
138169
*

0 commit comments

Comments
 (0)