Skip to content

Commit

Permalink
fix: Task Priorities
Browse files Browse the repository at this point in the history
  • Loading branch information
badalkhatri0924 committed Dec 2, 2023
1 parent 2279712 commit 994638a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
20 changes: 15 additions & 5 deletions apps/web/app/services/client/api/task-priorities.ts
Original file line number Diff line number Diff line change
@@ -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<CreateResponse<ITaskPrioritiesCreate>>('/task-priorities', data, {
Expand All @@ -21,8 +21,18 @@ export function deleteTaskPrioritiesAPI(id: string) {
return api.delete<DeleteResponse>(`/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}`
// );
}
6 changes: 3 additions & 3 deletions apps/web/app/services/server/requests/task-priorities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/pages/api/task-priorities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 994638a

Please sign in to comment.