-
Notifications
You must be signed in to change notification settings - Fork 1
qa(graduate) :제출 단건 승인/승인 취소 API 전환 및 관리자 상태 표시 정리 #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
40ed950
feat(graduate): 자격증·논문 관리 페이지 이름 클릭 상세보기 모달 공통 적용
kim-subsub ef616ce
refactor(graduate): admin 상세 타입/유틸 shared 공통화 및 pages 의존 제거
kim-subsub 87a226c
fix(graduate): 상세 상태 문구 정리
kim-subsub 0c28079
feat(graduate): 관리자 승인 거부 API 연동 및 결과 모달 추가
kim-subsub dcce4ec
feat(graduate) : 논문 승인 상태 판별 개선
kim-subsub 6f7b3c5
refactor(graduate): 승인 흐름을 feature 계층으로 분리
kim-subsub dfeebe1
refactor(graduate): Toolbar에서 학생 추가 책임을 분리
kim-subsub 0bc7c72
refactor(graduate): 관리 테이블 위젯과 공용 액션 상수 구조를 정리
kim-subsub 050e987
feat(graduate): 제출 단건 승인 및 승인 취소 API로 전환
kim-subsub 8a7e958
refactor(graduate): 미사용 관리자 Table 위젯을 제거
kim-subsub ca9e18d
fix(graduate): 관리자 상태 문구 깨짐 및 표시 타입을 정리
kim-subsub 7a4dc59
fix(graduate): 관리자 상태 문구 깨짐 복구
kim-subsub 76493e1
fix(graduate) : lint , build 오류 수정
kim-subsub 675bf35
refactor(graduate): 승인/승인 취소 훅 문자열 표현과 에러 처리 정리
kim-subsub File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
apps/graduate/src/admin/entities/graduation-approval/api/index.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './updateGraduationBatchApproval'; | ||
| export * from './updateGraduationApproval'; | ||
| export * from './updateGraduationDisapproval'; |
25 changes: 25 additions & 0 deletions
25
apps/graduate/src/admin/entities/graduation-approval/api/updateGraduationApproval.ts
This file contains hidden or 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,25 @@ | ||
| import { patch } from '~/shared/api'; | ||
| import { END_POINT } from '~/shared/constants'; | ||
|
|
||
| export type UpdateGraduationApprovalParams = { | ||
| graduationUserId: number; | ||
| submissionId: number; | ||
| }; | ||
|
|
||
| type UpdateGraduationApprovalResponse = { | ||
| id: number; | ||
| }; | ||
|
|
||
| export const updateGraduationApproval = async ({ | ||
| graduationUserId, | ||
| submissionId, | ||
| }: UpdateGraduationApprovalParams) => { | ||
| const response = await patch<UpdateGraduationApprovalResponse>({ | ||
| request: END_POINT.ADMIN.GRADUATION_USER_APPROVE( | ||
| graduationUserId, | ||
| submissionId, | ||
| ), | ||
| }); | ||
|
|
||
| return response.data; | ||
| }; |
22 changes: 0 additions & 22 deletions
22
apps/graduate/src/admin/entities/graduation-approval/api/updateGraduationBatchApproval.ts
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
apps/graduate/src/admin/entities/graduation-approval/api/updateGraduationDisapproval.ts
This file contains hidden or 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,25 @@ | ||
| import { patch } from '~/shared/api'; | ||
| import { END_POINT } from '~/shared/constants'; | ||
|
|
||
| export type UpdateGraduationDisapprovalParams = { | ||
| graduationUserId: number; | ||
| submissionId: number; | ||
| }; | ||
|
|
||
| type UpdateGraduationDisapprovalResponse = { | ||
| id: number; | ||
| }; | ||
|
|
||
| export const updateGraduationDisapproval = async ({ | ||
| graduationUserId, | ||
| submissionId, | ||
| }: UpdateGraduationDisapprovalParams) => { | ||
| const response = await patch<UpdateGraduationDisapprovalResponse>({ | ||
| request: END_POINT.ADMIN.GRADUATION_USER_DISAPPROVE( | ||
| graduationUserId, | ||
| submissionId, | ||
| ), | ||
| }); | ||
|
|
||
| return response.data; | ||
| }; |
4 changes: 2 additions & 2 deletions
4
apps/graduate/src/admin/entities/graduation-approval/model/index.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export * from './useGraduationApproval'; | ||
| export * from './useGraduationBatchApproval'; | ||
| export * from './useGraduationBatchApproval'; | ||
| export * from './useGraduationBatchDisapproval'; |
42 changes: 37 additions & 5 deletions
42
apps/graduate/src/admin/entities/graduation-approval/model/useGraduationBatchApproval.ts
This file contains hidden or 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
62 changes: 62 additions & 0 deletions
62
apps/graduate/src/admin/entities/graduation-approval/model/useGraduationBatchDisapproval.ts
This file contains hidden or 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,62 @@ | ||
| import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
|
|
||
| import { graduationUsersKeys, studentKeys } from '~/shared/queries'; | ||
|
|
||
| import { | ||
| type UpdateGraduationDisapprovalParams, | ||
| updateGraduationDisapproval, | ||
| } from '../api'; | ||
|
|
||
| type Options = { | ||
| onSuccess?: () => void | Promise<void>; | ||
| }; | ||
|
|
||
| type UpdateGraduationBatchDisapprovalResult = { | ||
| disapprovedIds: number[]; | ||
| successCount: number; | ||
| failureCount: number; | ||
| }; | ||
|
|
||
| export function useGraduationBatchDisapproval({ onSuccess }: Options = {}) { | ||
| const queryClient = useQueryClient(); | ||
|
|
||
| const mutation = useMutation< | ||
| UpdateGraduationBatchDisapprovalResult, | ||
| Error, | ||
| UpdateGraduationDisapprovalParams[] | ||
| >({ | ||
| mutationFn: async targets => { | ||
| const settled = await Promise.allSettled( | ||
| targets.map(target => updateGraduationDisapproval(target)), | ||
| ); | ||
| const disapprovedIds = settled.flatMap((result, index) => | ||
| result.status === 'fulfilled' | ||
| ? [targets[index].graduationUserId] | ||
| : [], | ||
| ); | ||
|
|
||
| return { | ||
| disapprovedIds, | ||
| successCount: disapprovedIds.length, | ||
| failureCount: targets.length - disapprovedIds.length, | ||
| }; | ||
| }, | ||
| onSuccess: async result => { | ||
| if (result.successCount === 0) { | ||
| return; | ||
| } | ||
| await queryClient.invalidateQueries({ | ||
| queryKey: graduationUsersKeys.all, | ||
| }); | ||
| await queryClient.invalidateQueries({ | ||
| queryKey: studentKeys.details(), | ||
| }); | ||
| await onSuccess?.(); | ||
| }, | ||
| }); | ||
|
|
||
| return { | ||
| disapproveGraduationUsers: mutation.mutateAsync, | ||
| mutation, | ||
| }; | ||
| } |
2 changes: 2 additions & 0 deletions
2
apps/graduate/src/admin/features/graduationApproval/hooks/index.ts
This file contains hidden or 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,2 @@ | ||
| export * from './useGraduationApproval'; | ||
| export * from './useGraduationDisapproval'; |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.