Skip to content

Commit

Permalink
Remove mocks from taskType api fetch (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
negreirosleo authored Oct 9, 2023
1 parent 7f68ec9 commit d333425
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions frontend/src/app/tasks/hooks/useTaskTypes.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import { useQuery } from '@tanstack/react-query'
import { useAuth } from 'react-oidc-context'
import { apiClient } from '@/infra/apiClient'

type TaskType = {
slug: string
name: string
active: boolean
}

// Temporary disable so we don't need to change the fetch api for now.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const fetchTaskTypes = (token: string): Promise<Array<TaskType>> => {
// return apiClient(token)
// .get('/v1/timelog/task_types/')
// .then((response) => response.data)
const mockData = Promise.resolve([
{ name: 'mock task type', slug: 'mock-test', active: true },
{ name: 'mock task type 2', slug: 'mock-test-2', active: true }
])
return mockData
return apiClient(token)
.get('/v1/timelog/task_types/')
.then((response) => response.data)
}

export const useTaskTypes = () => {
Expand Down

0 comments on commit d333425

Please sign in to comment.