Skip to content
Snippets Groups Projects
Commit efc0fe01 authored by Miah, Nunu (UG - Comp Sci & Elec Eng)'s avatar Miah, Nunu (UG - Comp Sci & Elec Eng)
Browse files

merged more changes

parent 43b3b336
No related branches found
No related tags found
2 merge requests!5Push to Main,!4Resolved Merge Conflicts.
......@@ -63,6 +63,7 @@ import { useWatchlist } from '@/composables/useWatchlist.js'
import WatchlistButton from '@/components/WatchlistButton.vue'
import { getAuth } from 'firebase/auth'
import { getFirestore, doc, getDoc } from 'firebase/firestore'
import { getAllReviews } from '@/composables/useReviews.js'
const route = useRoute()
const movie = ref(null)
......@@ -71,6 +72,8 @@ const loading = ref(true)
const error = ref('')
const movieId = ref(route.params.id)
const { isInWatchlist } = useWatchlist(movieId, movie)
const reviews = ref([])
const reviewsLoading = ref(true)
function formatDate(dateString) {
if (!dateString) return 'Unknown'
......@@ -114,6 +117,9 @@ onMounted(async () => {
await fetchMovieDetails(id)
await fetchMovieVideos(id)
const res = await getAllReviews(id)
reviews.value = res
const user = getAuth().currentUser
if (user) {
const db = getFirestore()
......@@ -122,6 +128,7 @@ onMounted(async () => {
isInWatchlist.value = snap.exists()
}
reviewsLoading.value = false
loading.value = false
})
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment