From ec9cbca147938063f5dca9587f4c7b988b1b4fc5 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Fri, 27 Mar 2026 19:41:03 +0530 Subject: [PATCH] learning online by default all as null --- src/components/LearningOnline.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/LearningOnline.tsx b/src/components/LearningOnline.tsx index 5eeef8e..54aec7d 100644 --- a/src/components/LearningOnline.tsx +++ b/src/components/LearningOnline.tsx @@ -53,7 +53,8 @@ export function LearningOnline() { const [selectedPriceRange, setSelectedPriceRange] = useState('All Prices'); const [selectedDuration, setSelectedDuration] = useState('All Durations'); const [selectedRating, setSelectedRating] = useState('All Ratings'); - const [sortBy, setSortBy] = useState('most_popular'); // ✅ Changed to match API value + const [sortBy, setSortBy] = useState(''); // ✅ Changed to match API value + // const [sortBy, setSortBy] = useState('most_popular'); // ✅ Changed to match API value const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid'); const [currentPage, setCurrentPage] = useState(1); const coursesPerPage = 9; @@ -204,7 +205,7 @@ export function LearningOnline() { // Sort by const apiSortBy = getSortByForApi(sortBy); - if (apiSortBy) { + if (apiSortBy && sortBy !== '') { filters.sort_by = apiSortBy; } @@ -290,7 +291,7 @@ export function LearningOnline() { setSelectedPriceRange('All Prices'); setSelectedDuration('All Durations'); setSelectedRating('All Ratings'); - setSortBy('most_popular'); // ✅ Updated to match API value + setSortBy(''); }; const hasActiveFilters = searchTerm || @@ -434,7 +435,7 @@ export function LearningOnline() { - -- 2.34.1