Skip to content

Commit

Permalink
fix: timer status API route error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric921 committed Jan 15, 2024
1 parent f473809 commit bb13272
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions apps/web/app/services/client/api/timer/timer-status.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import { ITimerStatus } from '@app/interfaces';
import { get } from '../../axios';
import { GAUZY_API_BASE_SERVER_URL } from '@app/constants';

export async function getTaskStatusList(
tenantId: string,
organizationId: string,
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<ITimerStatus>(endpoint, { tenantId });
}
Expand Down

0 comments on commit bb13272

Please sign in to comment.