Skip to content

Commit

Permalink
Merge pull request #61 from team-crews/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
Goonco authored Nov 10, 2024
2 parents a0114d9 + d1ab3b1 commit bbd7497
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
24 changes: 19 additions & 5 deletions src/app/apply/[recruitmentCode]/_components/footer-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
TooltipTrigger,
} from '../../../../components/shadcn/tooltip.tsx';
import useAtomicMutation from '../../../../hooks/use-atomic-mutation.ts';
import { useQueryClient } from '@tanstack/react-query';

const untouchedFieldIndex = {
name: 0,
Expand Down Expand Up @@ -56,6 +57,7 @@ const FooterSection = ({
}) => {
const { toast } = useToast();
const { handleSubmit, getValues, reset } = useFormContext<IFormApplication>();
const queryClient = useQueryClient();

const { recruitmentCode } = useParams<{ recruitmentCode: string }>();
const { saveApplication } = useApplicantApi(recruitmentCode!);
Expand Down Expand Up @@ -117,12 +119,24 @@ const FooterSection = ({

try {
const response = await saveMutate.mutateAsync(requestBody);
const convertedApplication = convertToFormApplication(
response,
generateChoiceMap(recruitment),
);

reset(convertedApplication);
/*
FixMe
- 지금 response 를 바탕으로 다시 form reset 하는건 좋은데 문제가 최초 생성하는 지원서일 경우 지원서의 id도 다시 갱신되어야합니다
- 이에 대한 처리가 따로 없는데 뭔가 위에 로직을 고치기 애매해서 우선 그냥 invalidate 시켜야할 것 같습니다.
*/
if (requestBody.id === null) {
await queryClient.invalidateQueries({
queryKey: ['readApplication', recruitmentCode],
});
} else {
const convertedApplication = convertToFormApplication(
response,
generateChoiceMap(recruitment),
);

reset(convertedApplication);
}

toast({
title: '지원서 저장이 완료되었습니다.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const OverviewCard = ({
)}
>
<div className="text-sm font-semibold text-crews-bk01">
<p>{applicationOverview.studentNumber}</p>
<p>{applicationOverview.name}</p>
<p className="mt-1 text-xs text-crews-g05">
<p className="line-clamp-1">{applicationOverview.studentNumber}</p>
<p className="line-clamp-1">{applicationOverview.name}</p>
<p className="mt-1 line-clamp-1 text-xs text-crews-g05">
{applicationOverview.major}
</p>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/app/recruit/_components/recruit-wait/footer-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ const FooterSection = ({
queryKey: ['recruitmentInProgressDetail'],
});
dialogReturns.toggleOpen();

toast({
title: '마감 기간이 연장되었습니다.',
state: 'success',
});
// FixMe
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/recruitment/info/_components/header-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const HeaderSection = () => {
</div>
<div className="flex flex-col gap-1 text-crews-g05">
<p className="text-base font-light">
모집 공고를 조회합니다. 하단의 '지원하기'를 눌러 원하는 모집에
지원해보세요!
하단의 '지원하기'를 눌러 원하는 모집에 지원해보세요!
</p>
<p className="text-base font-light">
또한 '지원서 미리보기'를 눌러 지원서의 내용을 확인할 수 있습니다.
Expand Down
2 changes: 1 addition & 1 deletion src/components/atom/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SpinnerIcon from '../../assets/icons/spinner-icon.svg?react';
const Loading = () => {
return (
<div className="fixed left-0 top-0 z-10 flex h-dvh w-dvw items-center justify-center bg-crews-g01 bg-opacity-30">
<SpinnerIcon className="h-10 w-10 animate-shake-infinite text-crews-b06" />
<SpinnerIcon className="h-10 w-10 animate-shake-infinite bg-transparent text-crews-b06" />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecule/crews-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const CrewsHeader = () => {
<p className="text-3xl font-semibold">Crews</p>
</Link>
<a href={import.meta.env.VITE_TEAM_INTRODUCE} target="_blank">
<p className="font-normal hover:underline">소개</p>
<p className="font-normal hover:underline">모집</p>
</a>
<a href={import.meta.env.VITE_GUIDE_BOOK} target="_blank">
<p className="font-normal hover:underline">안내서</p>
Expand Down

0 comments on commit bbd7497

Please sign in to comment.