diff --git a/apps/web/app/services/client/api/task-priorities.ts b/apps/web/app/services/client/api/task-priorities.ts index 9c299cb4d..2e39ce905 100644 --- a/apps/web/app/services/client/api/task-priorities.ts +++ b/apps/web/app/services/client/api/task-priorities.ts @@ -1,5 +1,5 @@ import { CreateResponse, DeleteResponse, ITaskPrioritiesCreate } from '@app/interfaces'; -import api from '../axios'; +import api, { get } from '../axios'; export function createTaskPrioritiesAPI(data: ITaskPrioritiesCreate, tenantId?: string) { return api.post>('/task-priorities', data, { @@ -21,8 +21,18 @@ export function deleteTaskPrioritiesAPI(id: string) { return api.delete(`/task-priorities/${id}`); } -export function getTaskPrioritiesList(tenantId: string, organizationId: string, activeTeamId: string | null) { - return api.get( - `/task-priorities?tenantId=${tenantId}&organizationId=${organizationId}&activeTeamId=${activeTeamId}` - ); +export async function getTaskPrioritiesList( + tenantId: string, + organizationId: string, + organizationTeamId: string | null +) { + const endpoint = `/task-priorities?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}`; + + const data = await get(endpoint, true, { tenantId }); + + return data; + + // return api.get( + // `/task-priorities?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}` + // ); } diff --git a/apps/web/app/services/server/requests/task-priorities.ts b/apps/web/app/services/server/requests/task-priorities.ts index 149062218..e4098116b 100644 --- a/apps/web/app/services/server/requests/task-priorities.ts +++ b/apps/web/app/services/server/requests/task-priorities.ts @@ -52,12 +52,12 @@ export function getTaskPrioritiesListRequest( { organizationId, tenantId, - activeTeamId - }: { tenantId: string; organizationId: string; activeTeamId: string | null }, + organizationTeamId + }: { tenantId: string; organizationId: string; organizationTeamId: string | null }, bearer_token: string ) { return serverFetch({ - path: `/task-priorities?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${activeTeamId}`, + path: `/task-priorities?tenantId=${tenantId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}`, method: 'GET', bearer_token }); diff --git a/apps/web/pages/api/task-priorities/index.tsx b/apps/web/pages/api/task-priorities/index.tsx index 22e40b6a9..62f95f1f3 100644 --- a/apps/web/pages/api/task-priorities/index.tsx +++ b/apps/web/pages/api/task-priorities/index.tsx @@ -7,12 +7,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) if (!user) return $res(); - const { activeTeamId } = req.query; + const { organizationTeamId } = req.query; const par = { tenantId, organizationId, - activeTeamId: (activeTeamId as string) || null + organizationTeamId: (organizationTeamId as string) || null }; switch (req.method) {