added params for refetch data
This commit is contained in:
parent
b18e0e4dd7
commit
c722117108
@ -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]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user