-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 합격자 결과 발송 기능 제작 #338
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
+174
−68
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7511556
fix: ApplicantsList 버그 수정
Superkid0714 3e531aa
feat: 지원자 이메일 발송 기능 추가
Superkid0714 fb31e9c
fix: 합격 상태 관리 페이지 레이아웃 수정
Superkid0714 7efe76d
fix : needValidatePath에 pass-state 경로 추가
Superkid0714 5b825c4
fix : EMAIL_STATE_LABEL_MAP 상수 정의
Superkid0714 9ee07cf
fix : 일괄 발송 버튼에서 truncate 제거
Superkid0714 205a4b5
fix: 이메일 발송 관련 코드 정리 및 불필요한 기능 제거
Superkid0714 f01efa3
feat: 일괄 이메일 발송 버튼 컴포넌트 추가
Superkid0714 3757bf5
feat: BulkEmailButtons 컴포넌트 추가
Superkid0714 1f3559f
refactor: 상수로 이메일 상태 관리 개선
Superkid0714 3eaebd8
fix: 이메일 발송 함수에 성공 및 오류 처리 추가
Superkid0714 3d9fdf8
fix: 페이지 레이아웃 조정
Superkid0714 43c4a7e
style: 일괄 발송 제목 스타일 조정
Superkid0714 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
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
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
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,53 @@ | ||
| "use client"; | ||
|
|
||
| import { sendEmailToAll, type EmailState } from "@/src/apis/passState"; | ||
| import { useMutation } from "@tanstack/react-query"; | ||
| import { usePathname } from "next/navigation"; | ||
|
|
||
| const EMAIL_STATE_LABEL_MAP: Record<EmailState, string> = { | ||
| "first-passed": "1차 합격자", | ||
| "first-failed": "1차 불합격자", | ||
| "final-passed": "최종 합격자", | ||
| "final-failed": "최종 불합격자", | ||
| }; | ||
|
|
||
| const EMAIL_STATES = Object.keys(EMAIL_STATE_LABEL_MAP) as EmailState[]; | ||
|
|
||
| const BulkEmailButtons = () => { | ||
| const selectedGeneration = usePathname().split("/")[2]; | ||
| const { mutate: sendEmailAll } = useMutation(sendEmailToAll); | ||
|
|
||
| const onSendEmailAll = (state: EmailState) => { | ||
| const ok = confirm( | ||
| `${EMAIL_STATE_LABEL_MAP[state]} 전체에게 결과 이메일을 발송하시겠습니까?` | ||
| ); | ||
| if (!ok) return; | ||
| sendEmailAll( | ||
| { year: Number(selectedGeneration), state }, | ||
| { | ||
| onSuccess: () => alert(`${EMAIL_STATE_LABEL_MAP[state]} 이메일 발송이 완료되었습니다.`), | ||
| onError: () => alert(`이메일 발송 중 오류가 발생했습니다. 다시 시도해주세요.`), | ||
| } | ||
| ); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-2"> | ||
| <h6 className="text-base font-bold text-secondary-100">일괄 발송</h6> | ||
| <div className="flex gap-2 flex-wrap"> | ||
| {EMAIL_STATES.map((state) => ( | ||
| <button | ||
| key={state} | ||
| type="button" | ||
| className="border px-4 py-2 rounded-lg hover:bg-primary-100" | ||
| onClick={() => onSendEmailAll(state)} | ||
| > | ||
| {EMAIL_STATE_LABEL_MAP[state]} 일괄 발송 | ||
| </button> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default BulkEmailButtons; |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
/pass-stateroute is missing from theneedValidatePathlist infrontend/src/constants/index.ts. This list defines the routes that require authentication and authorization (e.g.,/admin,/kanban,/applicant). Since this page allows managing applicant pass states and sending sensitive result emails, it should be protected to prevent unauthorized access. An attacker could potentially navigate to/pass-state/[generation]and perform administrative actions without proper authentication.