Skip to content

Commit

Permalink
Merge pull request #898 from KEEPER31337/feature/검색창_기수별_정렬순서_수정_#892
Browse files Browse the repository at this point in the history
Feature/검색창 기수별 정렬순서 수정 #892
  • Loading branch information
oxomi authored Jun 4, 2024
2 parents 3a59054 + e3f3b74 commit bc6a96e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const MemberTypeChangeInput = ({
}: MemberTypeChangeInputProps) => {
const options: { value: number; label: string; group: string }[] = [];
memberList?.forEach((data) => options.push({ value: data.memberId, label: data.realName, group: data.generation }));
const sortedOptions = options.sort((a, b) => (a.group > b.group ? 1 : -1));
const sortedOptions = options.sort(
(a, b) => parseFloat(a.group) - parseFloat(b.group) || a.label.localeCompare(b.label),
);

return (
<AutoComplete
Expand Down
4 changes: 3 additions & 1 deletion src/pages/admin/DutyManage/Modal/ChangeRolePersonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const ChangeRolePersonModal = ({ open, toggleOpen, jobName, badgeImage }: Change

const options: { value: number; label: string; group: string }[] = [];
memberList?.forEach((data) => options.push({ value: data.memberId, label: data.realName, group: data.generation }));
const sortedOptions = options.sort((a, b) => (a.group > b.group ? 1 : -1));
const sortedOptions = options.sort(
(a, b) => parseFloat(a.group) - parseFloat(b.group) || a.label.localeCompare(b.label),
);

const [value, setValue] = useState<SingleAutoCompleteValue>(null);
const [prevInfo, setPrevInfo] = useState<{ value: number; label: string; group: string }>({
Expand Down

0 comments on commit bc6a96e

Please sign in to comment.