From 00e301769c42135ad090054347b30246e4070132 Mon Sep 17 00:00:00 2001 From: Paradoxe Ngwasi Date: Fri, 26 Jan 2024 21:55:08 +0000 Subject: [PATCH] implement GET /tasks/employee/:id api frontend --- .../app/api/tasks/employee/[employeeId]/route.ts | 16 ++++++++-------- apps/web/app/services/client/api/tasks.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/web/app/api/tasks/employee/[employeeId]/route.ts b/apps/web/app/api/tasks/employee/[employeeId]/route.ts index 09571f0ef..265cec263 100644 --- a/apps/web/app/api/tasks/employee/[employeeId]/route.ts +++ b/apps/web/app/api/tasks/employee/[employeeId]/route.ts @@ -14,14 +14,14 @@ export async function GET(req: Request, { params }: { params: { employeeId: stri organizationTeamId: string; }; - return $res( - await getEmployeeTasksRequest({ - tenantId, - employeeId, - organizationTeamId, - bearer_token - }) - ); + const response = await getEmployeeTasksRequest({ + tenantId, + employeeId, + organizationTeamId, + bearer_token + }); + + return $res(response.data); } export async function DELETE(req: Request, { params }: { params: { employeeId: string } }) { diff --git a/apps/web/app/services/client/api/tasks.ts b/apps/web/app/services/client/api/tasks.ts index 5ecdbcd37..ec9b1e961 100644 --- a/apps/web/app/services/client/api/tasks.ts +++ b/apps/web/app/services/client/api/tasks.ts @@ -273,5 +273,5 @@ export function deleteEmployeeFromTasksAPI(employeeId: string, organizationTeamI } export function getTasksByEmployeeIdAPI(employeeId: string, organizationTeamId: string) { - return api.get(`/tasks/employee/${employeeId}?organizationTeamId=${organizationTeamId}`); + return get(`/tasks/employee/${employeeId}?organizationTeamId=${organizationTeamId}`); }