added params for refetch data

This commit is contained in:
Pramod Mahajan 2025-06-17 20:40:51 +05:30
parent b18e0e4dd7
commit c722117108

View File

@ -9,7 +9,7 @@ export const useTaskList = (projectId, dateFrom, toDate) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [error, setError] = useState(null); const [error, setError] = useState(null);
const fetchList = async () => { const fetchList = async (projectId, dateFrom, toDate) => {
const taskList_cached = getCachedData("taskList"); const taskList_cached = getCachedData("taskList");
// if (!taskList_cached || taskList_cached?.projectId !== projectId) { // if (!taskList_cached || taskList_cached?.projectId !== projectId) {
try { try {
@ -34,7 +34,7 @@ export const useTaskList = (projectId, dateFrom, toDate) => {
{ {
if (projectId && dateFrom && toDate) { if (projectId && dateFrom && toDate) {
fetchList(); fetchList(projectId, dateFrom, toDate);
} }
}, [projectId, dateFrom, toDate]); }, [projectId, dateFrom, toDate]);