Skip to content

Commit

Permalink
feat(dashboard): get requested task list
Browse files Browse the repository at this point in the history
  • Loading branch information
suzit-10 committed Aug 1, 2024
1 parent 6e5ff8d commit 38feef2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/frontend/src/api/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable import/prefer-default-export */
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
import { getRequestedTasks } from '@Services/project';

export const useGetRequestedTasksListQuery = (
queryOptions?: Partial<UseQueryOptions>,
) => {
return useQuery({
queryKey: ['requested-task-list'],
queryFn: getRequestedTasks,
select: (res: any) => res.data,
...queryOptions,
});
};
2 changes: 2 additions & 0 deletions src/frontend/src/services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export const postTaskStatus = (payload: Record<string, any>) => {
headers: { 'Content-Type': 'application/json' },
});
};
export const getRequestedTasks = () =>
authenticated(api).get('/tasks/requested_tasks/pending');

0 comments on commit 38feef2

Please sign in to comment.