diff --git a/apps/web/app/services/client/api/timer/timer-status.ts b/apps/web/app/services/client/api/timer/timer-status.ts index 44c0ebedd..63ab1693a 100644 --- a/apps/web/app/services/client/api/timer/timer-status.ts +++ b/apps/web/app/services/client/api/timer/timer-status.ts @@ -1,5 +1,6 @@ import { ITimerStatus } from '@app/interfaces'; import { get } from '../../axios'; +import { GAUZY_API_BASE_SERVER_URL } from '@app/constants'; export async function getTaskStatusList( tenantId: string, @@ -7,18 +8,22 @@ export async function getTaskStatusList( employeeId: string, organizationTeamId: string | null ) { - const params = { + const params: { + tenantId: string; + organizationId: string; + employeeId: string; + organizationTeamId?: string; + } = { tenantId: tenantId, organizationId: organizationId, - employeeId: employeeId, - organizationTeamId:organizationTeamId + employeeId: employeeId }; + if (organizationTeamId) params.organizationTeamId = organizationTeamId; const query = new URLSearchParams(params); - const endpoint = - GAUZY_API_BASE_SERVER_URL.value ? - `/timesheet/timer/status?${query.toString()}` : - `/timer/status?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}&employeeId=${employeeId}`; + const endpoint = GAUZY_API_BASE_SERVER_URL.value + ? `/timesheet/timer/status?${query.toString()}` + : `/timer/status?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}&employeeId=${employeeId}`; return get(endpoint, { tenantId }); }