Skip to content

Commit

Permalink
Merge pull request #45 from bendsouza2/bug/video-date-field
Browse files Browse the repository at this point in the history
change field name from upload_date to upload_time
  • Loading branch information
bendsouza2 authored Dec 23, 2024
2 parents c87d8d3 + bde1099 commit 2e1faea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/today/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class Meta:
"translated_sentence",
"title",
"description",
"upload_date",
"upload_time",
"thumbnail_url",
]
2 changes: 1 addition & 1 deletion app/today/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class VideoDetailsViewSet(viewsets.ModelViewSet):

@action(detail=False, methods=["get"], url_path="latest")
def latest_video(self, request):
recent_video = self.get_queryset().order_by("-upload_date").first()
recent_video = self.get_queryset().order_by("-upload_time").first()
if recent_video is not None:
serializer = self.get_serializer(recent_video)
return Response(serializer.data)
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/LatestVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="background-container">
<div class="top-content">
<h1>Spanish Word of the Day</h1>
<h2 v-if="video.upload_date">{{ video.upload_date }}</h2>
<h2 v-if="video.upload_time">{{ video.upload_time }}</h2>
</div>

<div v-if="video.video_id" class="video-container">
Expand Down Expand Up @@ -56,7 +56,7 @@ const video = reactive({
word: "",
sentence: "",
translated_sentence: "",
upload_date: "",
upload_time: "",
});
const flipped = ref(false);
Expand All @@ -76,7 +76,7 @@ async function fetchVideos() {
video.word = response.data.word || "";
video.sentence = response.data.sentence || "";
video.translated_sentence = response.data.translated_sentence || "";
video.upload_date = formatDate(new Date(response.data.upload_date)) || "";
video.upload_time = formatDate(new Date(response.data.upload_time)) || "";
} else {
console.error("Error: No data received from API.");
}
Expand Down

0 comments on commit 2e1faea

Please sign in to comment.