-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c55d1c
commit 2149a11
Showing
5 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import axios from 'axios'; | ||
|
||
import { TIMER_MOCK_URL } from '@/mocks/timer/resolvers/timerResolvers'; | ||
|
||
export const postTimerStop = async (taskId: string, targetDate: string, elapsedTime: number) => { | ||
const url = TIMER_MOCK_URL.POST_TIMER_STOP.replace(':taskId', taskId); | ||
const { data } = await axios.post(url, { | ||
targetDate: targetDate, | ||
elapsedTime: elapsedTime, | ||
}); | ||
return data; | ||
}; | ||
|
||
export const getTodoCard = async (targetDate: string) => { | ||
const { data } = await axios.get(TIMER_MOCK_URL.GET_TODO_CARD, { | ||
params: { targetDate }, | ||
}); | ||
return data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
import { getTodoCard } from '../axios'; | ||
|
||
export const useGetTodoCard = (targetDate: string) => { | ||
return useQuery({ | ||
queryKey: ['todo', targetDate], | ||
queryFn: () => getTodoCard(targetDate), | ||
}); | ||
}; |