You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The End date feature in the Search route isn't working, I have tried many times with many start and end dates but Its not working, It's giving me the same result for every single end date.
Expected behavior
I thought it's happening because of my fromatDate() func, but there are no issues
Actual behavior
I have tried with 2 different end dates here and its giving me the same result, it happens with every single end date
Describe the bug
The End date feature in the Search route isn't working, I have tried many times with many start and end dates but Its not working, It's giving me the same result for every single end date.
Expected behavior
I thought it's happening because of my fromatDate() func, but there are no issues
Actual behavior
I have tried with 2 different end dates here and its giving me the same result, it happens with every single end date
Additional context
const {
data: searchResults,
isLoading,
fetchNextPage,
hasNextPage,
isFetchingNextPage,
} = useInfiniteQuery({
queryKey: [
"search",
debouncedSearchQuery,
type,
status,
season,
sort,
genres,
startDate,
endDate,
rated,
score,
language,
],
queryFn: async ({ pageParam = 1 }) => {
const formatDate = (date) => {
if (!date) return "";
const [year, month, day] = date.split("-").map((part) => part || "0");
return
${year}-${month}-${day}
;};
const response = await axios.get(
${api}/hianime/search?q=${encodeURIComponent( debouncedSearchQuery )}&type=${type}&status=${status}&season=${season}&sort=${sort}&genres=${genres}&page=${pageParam}&start_date=${formatDate( startDate )}&end_date=${formatDate( endDate )}&rated=${rated}&score=${score}&language=${language}
);
return response.data;
},
initialPageParam: 1,
getNextPageParam: (lastPage) =>
lastPage?.data?.hasNextPage ? lastPage?.data?.currentPage + 1 : undefined,
enabled: debouncedSearchQuery.length > 0,
});
const debouncedSetSearchQuery = useCallback(
debounce((value) => {
setSearchQuery(value);
}, 500),
[setSearchQuery]
);
const handleSearchInput = (e) => {
const value = e.target.value;
debouncedSetSearchQuery(value);
};
No response
The text was updated successfully, but these errors were encountered: