Skip to content

Commit fd99634

Browse files
committed
Refactor track_interaction method to use query parameters for interaction type and search query
1 parent c3621a6 commit fd99634

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
49 Bytes
Binary file not shown.

core/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ def get_recommendations_by_movie_idx(self, request):
266266
def track_interaction(self, request, pk=None):
267267
"""Track user interaction with a movie"""
268268
movie = get_object_or_404(Movie, id=pk)
269-
interaction_type = request.data.get('interaction_type', 'VIEW')
270-
search_query = request.data.get('search_query', "")
271-
269+
interaction_type = request.query_params.get('interaction_type', 'VIEW')
270+
search_query = request.query_params.get('search_query', "")
271+
print(movie, interaction_type, search_query)
272272
MovieInteraction.objects.create(
273273
movie=movie,
274274
interaction_type=interaction_type,

0 commit comments

Comments
 (0)