Skip to content

Commit

Permalink
Merge pull request #3071 from ever-co/fix-daily-plans-fetch
Browse files Browse the repository at this point in the history
Daily plan requests | employeeId should be a string
  • Loading branch information
evereq authored Sep 26, 2024
2 parents 9214e64 + 779b562 commit e1e8819
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/web/app/hooks/features/useDailyPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
Expand Down

0 comments on commit e1e8819

Please sign in to comment.