-
Notifications
You must be signed in to change notification settings - Fork 0
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 #63 from KERT-core/feat/history-detail
Feat: 연혁 상세 페이지 개발
- Loading branch information
Showing
5 changed files
with
111 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useQuery } from 'react-query'; | ||
import { API } from '@/utils/api'; | ||
import { refineHistories } from '../../utils/refineHistory'; | ||
|
||
export function useHistoriesQuery() { | ||
return useQuery({ | ||
queryKey: 'histories', | ||
queryFn: async () => { | ||
try { | ||
const res = await API.GET('/histories'); | ||
return refineHistories(res.data); | ||
} catch { | ||
console.warn(`History API 요청에 실패했습니다.`); | ||
return {}; | ||
} | ||
}, | ||
}); | ||
} |
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