-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 어드민 서류확인페이지 오류 수정 및 검색창 기능 수정 (#128) * Feat: 서류확인 페이지 테이블 구현 * Feat: 트랙별 조회기능 구현 * Chore: 쓰지않는 훅 삭제 * Feat: 서류합격자 조회기능 구현 * Feat: 모달창 open 기능 구현 * Chore: 필요없는 파일 제거 * Refactor: TrackSelectBar lazyloading 적용 * Feat: 검색창 실시간 동기화로 변경, 디바운스적용 * Feat: 모바일 캐러셀 링크 추가 --------- Co-authored-by: CHAE_WON_SHIN <[email protected]>
- Loading branch information
1 parent
89bf173
commit ae46cc7
Showing
14 changed files
with
321 additions
and
356 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { fetchInstance } from '@gdsc/apis/instance/Api_JWT'; | ||
|
||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export interface TrackInterface { | ||
TOTAL: number; | ||
FRONT_END: number; | ||
BACK_END: number; | ||
ANDROID: number; | ||
AI: number; | ||
DESIGNER: number; | ||
[key: string]: number; | ||
} | ||
|
||
const getTrackPath = () => '/api/admin/application/statistic/track'; | ||
|
||
const statisticQueryKey = [getTrackPath()]; | ||
|
||
const getTrack = async (): Promise<TrackInterface> => { | ||
const response = await fetchInstance.get<TrackInterface>(getTrackPath()); | ||
|
||
const total = Object.values(response.data).reduce((accumulator, current) => { | ||
return accumulator + current; | ||
}, 0); | ||
|
||
const trackData: TrackInterface = { ...response.data, TOTAL: total }; | ||
return trackData; | ||
}; | ||
|
||
export const useGetTrack = () => { | ||
const accessToken = sessionStorage.getItem('accessToken'); | ||
|
||
return useQuery<TrackInterface, Error>({ | ||
queryKey: [statisticQueryKey], | ||
queryFn: getTrack, | ||
enabled: !!accessToken, | ||
}); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
import star from '@gdsc/assets/admin/miniStar.svg'; | ||
|
||
import { MemberData } from '@gdsc/types/AdminInterface'; | ||
import { createColumnHelper } from '@tanstack/react-table'; | ||
|
||
const columnHelper = createColumnHelper<MemberData>(); | ||
|
||
const formatDate = (dateString: string) => { | ||
const date = new Date(dateString); | ||
const year = String(date.getFullYear()).slice(2); | ||
const month = String(date.getMonth() + 1).padStart(2, '0'); | ||
const day = String(date.getDate()).padStart(2, '0'); | ||
|
||
return `${year}-${month}-${day}`; | ||
}; | ||
|
||
export const columns = () => [ | ||
columnHelper.accessor('marked', { | ||
header: '', | ||
cell: ({ getValue }) => { | ||
return getValue() ? <img src={star} alt='marked' /> : null; | ||
}, | ||
}), | ||
columnHelper.accessor('name', { header: '이름' }), | ||
columnHelper.accessor('submittedAt', { | ||
header: '지원일자', | ||
cell: (props) => <p>{formatDate(props.getValue())}</p>, | ||
}), | ||
columnHelper.accessor('studentNumber', { header: '학번' }), | ||
columnHelper.accessor('major', { header: '학과' }), | ||
columnHelper.accessor('track', { header: '지원영역' }), | ||
columnHelper.accessor('open', { header: '열람' }), | ||
]; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.