Logs for errors

This commit is contained in:
austinkelsay 2024-10-13 17:59:04 -05:00
parent 45b6b66f33
commit 178fb6a927
2 changed files with 5 additions and 1 deletions

View File

@ -52,12 +52,17 @@ export default function VideosCarousel() {
try { try {
if (videos && videos.length > 0 && paidLessons.length > 0) { if (videos && videos.length > 0 && paidLessons.length > 0) {
const processedVideos = videos.map(video => parseEvent(video)); const processedVideos = videos.map(video => parseEvent(video));
console.log("processedVideos", processedVideos);
const sortedVideos = processedVideos.sort((a, b) => b.created_at - a.created_at); const sortedVideos = processedVideos.sort((a, b) => b.created_at - a.created_at);
console.log("paidLessons", paidLessons);
// filter out videos that are in the paid lessons array // filter out videos that are in the paid lessons array
const filteredVideos = sortedVideos.filter(video => !paidLessons.includes(video?.resource?.resourceId)); const filteredVideos = sortedVideos.filter(video => !paidLessons.includes(video?.resource?.resourceId));
console.log("filteredVideos", filteredVideos);
setProcessedVideos(filteredVideos); setProcessedVideos(filteredVideos);
} else { } else {
console.log('No videos fetched or empty array returned'); console.log('No videos fetched or empty array returned');

View File

@ -58,7 +58,6 @@ export function useVideos() {
if (isClient && contentIds) { if (isClient && contentIds) {
fetchVideosFromNDK().then(fetchedVideos => { fetchVideosFromNDK().then(fetchedVideos => {
if (fetchedVideos && fetchedVideos.length > 0) { if (fetchedVideos && fetchedVideos.length > 0) {
console.log('fetchedvideos', fetchedVideos)
setVideos(fetchedVideos); setVideos(fetchedVideos);
} }
}); });