-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from Team-Lecue/feature/Splash
Merge Feature/splash into develop
- Loading branch information
Showing
4 changed files
with
33 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { api } from './../../libs/api'; | ||
const getNoteNum = async () => { | ||
const { data } = await api.get('/api/common/splash'); | ||
return data; | ||
}; | ||
|
||
export default getNoteNum; |
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,17 @@ | ||
import { useQuery } from 'react-query'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import getNoteNum from '../api/getNoteNum'; | ||
|
||
const useGetNoteNum = () => { | ||
const navigate = useNavigate(); | ||
const { isLoading, data } = useQuery({ | ||
queryKey: ['get-note-num'], | ||
queryFn: () => getNoteNum(), | ||
onError: () => navigate('/error'), | ||
}); | ||
|
||
return { isLoading, data }; | ||
}; | ||
|
||
export default useGetNoteNum; |
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