feat: it will auto load the new filters

This commit is contained in:
Nevo David 2024-09-09 12:09:41 +07:00
parent 9974e71859
commit 048df4fb44
1 changed files with 2 additions and 5 deletions

View File

@ -109,8 +109,8 @@ export const CalendarWeekProvider: FC<{
}, [filters]);
const loadData = useCallback(
async (url: string) => {
const data = (await fetch(`/posts${url}?${params}`)).json();
async () => {
const data = (await fetch(`/posts?${params}`)).json();
return data;
},
[filters, params]
@ -141,9 +141,6 @@ export const CalendarWeekProvider: FC<{
: `month=${filters.currentMonth}`
}&year=${filters.currentYear}`
);
setTimeout(() => {
swr.mutate();
}, 10);
},
[filters, swr.mutate]
);