Skip to content

Commit

Permalink
feat: 본인은 공동 모임장 검색이 되지 않도록 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
ocahs9 committed Nov 11, 2024
1 parent fabcf36 commit 7339b45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions pages/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ const SNoticeWrapper = styled('div', {
'@tablet': {
mt: '$28',
},

});
1 change: 0 additions & 1 deletion src/api/API_LEGACY/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export const createMeeting = async (formData: FormType) => {

export const updateMeeting = async (meetingId: string, formData: FormType) => {
const response = await api.put(`/meeting/v2/${meetingId}`, serializeFormData(formData));

return response;
};

Expand Down
8 changes: 6 additions & 2 deletions src/components/form/Presentation/CoLeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { IconXCircle } from '@sopt-makers/icons';
import { useQueryGetMentionUsers } from '@api/user/hooks';
import { fontsObject } from '@sopt-makers/fonts';
import { IconXClose } from '@sopt-makers/icons';
import { useQueryMyProfile } from '@api/API_LEGACY/user/hooks';

interface CoLeaderFieldProps {
value: mentionableDataType[];
Expand All @@ -28,7 +29,10 @@ interface mentionableDataType {
}

const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps) => {
const { data: user } = useQueryMyProfile();
const { data: mentionUserList } = useQueryGetMentionUsers();
//API 연결에서 타입을 지정해두지 않았기 때문에 any 이용
const filteredMeList = mentionUserList?.filter((mentionUser: any) => mentionUser.userId !== user?.id);

const handleUserSelect = (user: mentionableDataType) => {
if (coLeaders.length < 3 && !coLeaders.some(leader => leader.id === user.id)) {
Expand Down Expand Up @@ -87,7 +91,7 @@ const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps
<CommentInput onClick={e => e.stopPropagation()}>
<InputBox isActive={comment !== ''}>
<SearchMention
mentionUserList={mentionUserList}
mentionUserList={filteredMeList}
inputRef={inputRef}
value={comment}
setValue={setComment}
Expand All @@ -112,7 +116,7 @@ const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps
<CommentInput onClick={e => e.stopPropagation()}>
<InputBox isActive={comment !== ''}>
<SearchMention
mentionUserList={mentionUserList}
mentionUserList={filteredMeList}
inputRef={inputRef}
value={comment}
setValue={setComment}
Expand Down

0 comments on commit 7339b45

Please sign in to comment.