Skip to content

Commit

Permalink
fix-fe: processList orderIndex 해제 버그 (#914)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kim Da Eun <midekuna@gmail.com>
  • Loading branch information
2 people authored and seongjinme committed Oct 23, 2024
1 parent 0b2cdbf commit 26cdff9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
Binary file modified frontend/src/assets/images/dashboard.webp
Binary file not shown.
Binary file modified frontend/src/assets/images/feature1.webp
Binary file not shown.
18 changes: 10 additions & 8 deletions frontend/src/components/ApplicantModal/ApplicantBaseInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ export default function ApplicantBaseInfo({ applicantId }: ApplicantBaseInfoProp

const { applicant, process } = applicantBaseInfo;

const menuItems: DropdownItemType[] = processList.map(({ processName, processId }) => ({
type: 'clickable',
id: processId,
name: processName,
onClick: ({ targetProcessId }) => {
moveApplicantProcess({ processId: targetProcessId, applicants: [applicantId] });
},
}));
const menuItems: DropdownItemType[] = processList
.filter(({ processId }) => processId !== process.id)
.map(({ processName, processId }) => ({
type: 'clickable',
id: processId,
name: processName,
onClick: ({ targetProcessId }) => {
moveApplicantProcess({ processId: targetProcessId, applicants: [applicantId] });
},
}));

const rejectAppHandler = () => {
const confirmAction = (message: string, action: () => void) => {
Expand Down
19 changes: 10 additions & 9 deletions frontend/src/components/dashboard/ProcessColumn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ export default function ProcessColumn({
removeApplicant,
removeApplicants,
} = useMultiApplicant();

const menuItemsList = ({ applicantId }: { applicantId: number }) => {
const menuItems: DropdownItemType[] = [
{
type: 'subTrigger',
id: 'moveProcess',
name: '단계 이동',
items: processList.map(({ processName, processId }) => ({
type: 'clickable',
id: processId,
name: processName,
onClick: ({ targetProcessId }) => {
moveApplicantProcess({ processId: targetProcessId, applicants: [applicantId] });
},
})),
items: processList
.filter((simpleProcess) => simpleProcess.processId !== process.processId)
.map(({ processName, processId }) => ({
type: 'clickable',
id: processId,
name: processName,
onClick: ({ targetProcessId }) => {
moveApplicantProcess({ processId: targetProcessId, applicants: [applicantId] });
},
})),
},
{
type: 'clickable',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/hooks/useApplicant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function useApplicant({ applicantId }: { applicantId?: number })
return useMutation({
mutationFn: ({ processId, applicants }: { processId: number; applicants: number[] }) =>
applicantApis.move({ processId, applicants }),

onSuccess: (_, variables) => {
const { processId } = variables;
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DASHBOARD, dashboardId, applyFormId] });
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useProcess/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function useProcess({ dashboardId, applyFormId }: UseProcessProps
return {
title: data?.title ?? '',
postUrl: `${DOMAIN_URL}${routes.post({ applyFormId: data?.applyFormId ?? '' })}`,
processes,
processes: processes.sort((processA, processB) => processA.orderIndex - processB.orderIndex),
processList,
error,
isLoading,
Expand Down

0 comments on commit 26cdff9

Please sign in to comment.