diff --git a/apps/web/app/hooks/features/useDailyPlan.ts b/apps/web/app/hooks/features/useDailyPlan.ts index 7f46646fa..e0d038ba1 100644 --- a/apps/web/app/hooks/features/useDailyPlan.ts +++ b/apps/web/app/hooks/features/useDailyPlan.ts @@ -82,11 +82,13 @@ export function useDailyPlan() { const getEmployeeDayPlans = useCallback( (employeeId: string) => { - queryCall(employeeId).then((response) => { - const { items, total } = response.data; - setProfileDailyPlans({ items, total }); - setEmployeePlans(items); - }); + if (employeeId && typeof employeeId === 'string') { + queryCall(employeeId).then((response) => { + const { items, total } = response.data; + setProfileDailyPlans({ items, total }); + setEmployeePlans(items); + }); + } }, [queryCall, setEmployeePlans, setProfileDailyPlans] );