Skip to content

Commit

Permalink
Merge pull request #966 from sopt-makers/develop
Browse files Browse the repository at this point in the history
프로덕션 배포
  • Loading branch information
ocahs9 authored Nov 24, 2024
2 parents 201b85d + 34eb6ab commit c130de6
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 22 deletions.
6 changes: 2 additions & 4 deletions src/api/API_LEGACY/meeting/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ export const useQueryGetMeetingPeopleList = ({
});
};

export const useMutationDeleteMeeting = ({
useMutationOptions,
}: UseMutateBody<number>): UseMutationResult<{ statusCode: number }, AxiosError, number> => {
return useMutation<{ statusCode: number }, AxiosError, number>({
export const useMutationDeleteMeeting = ({ useMutationOptions }: UseMutateBody<number>) => {
return useMutation({
...useMutationOptions,
mutationKey: ['deleteMeeting'],
mutationFn: deleteMeeting,
Expand Down
6 changes: 3 additions & 3 deletions src/api/API_LEGACY/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ export const getMeetingPeopleList = async ({ id, ...rest }: OptionData): Promise
).data.data;
};

export const deleteMeeting = async (id: number): Promise<{ statusCode: number }> => {
return (await api.delete<{ statusCode: number }>(`/meeting/${id}`)).data;
export const deleteMeeting = async (id: number) => {
return (await api.delete(`/meeting/v2/${id}`)).data;
};

export const postApplication = async (body: PostApplicationRequest): Promise<{ statusCode: number }> => {
Expand All @@ -226,7 +226,7 @@ export const deleteApplication = async (meetingId: number): Promise<{ statusCode
};

export const updateApplication = async ({ id, ...rest }: UpdateApplicationRequest) => {
return (await api.put(`/meeting/${id}/apply/status`, rest)).data;
return (await api.put(`/meeting/v2/${id}/apply/status`, rest)).data;
};

const serializeFormData = (formData: FormType) => {
Expand Down
4 changes: 1 addition & 3 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ export type PromiseResponse<T> = { data: T; statusCode: number };
export type Data<T> = PromiseResponse<T>;

const baseURL =
process.env.NEXT_PUBLIC_APP_ENV === 'production'
? 'https://crew.api.prod.sopt.org'
: 'https://crew.api.develop.sopt.org';
process.env.NEXT_PUBLIC_APP_ENV === 'production' ? 'https://crew.api.prod.sopt.org' : 'https://crew.api.dev.sopt.org';

const playgroundBaseURL =
process.env.NEXT_PUBLIC_APP_ENV === 'production'
Expand Down
3 changes: 2 additions & 1 deletion src/components/form/CheckBox/NeedMentor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export default NeedMentor;
const SNeedMentorField = styled('label', {
display: 'flex',
alignItems: 'center',
gap: '4px',
gap: '$4',
cursor: 'pointer',
paddingBottom: '$8',
});

const SNeedMentorLabel = styled('span', {
Expand Down
18 changes: 14 additions & 4 deletions src/components/form/Presentation/CoLeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ interface metionUserType {
const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps) => {
const { data: user } = useQueryMyProfile();
const { data: mentionUserList } = useQueryGetMentionUsers();
//API 연결에서 타입을 지정해두지 않았기 때문에 any 이용
const containerRef = useRef<HTMLDivElement | null>(null);

const filteredMeList = mentionUserList?.filter((mentionUser: metionUserType) => mentionUser.userId !== user?.id);

const handleUserSelect = (user: mentionableDataType) => {
Expand All @@ -64,8 +65,17 @@ const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps
setIsMobile(window.innerWidth <= 414);
};
window.addEventListener('resize', handleResize);

const handleClickOutSide = (event: MouseEvent) => {
if (containerRef.current && !containerRef.current.contains(event.target as Node)) setShowInput(false);
};

handleResize(); // Initial check
return () => window.removeEventListener('resize', handleResize);
document.addEventListener('mousedown', handleClickOutSide);
return () => {
window.removeEventListener('resize', handleResize);
document.removeEventListener('mousedown', handleClickOutSide);
};
}, []);

const handleBackdropClick = () => {
Expand All @@ -78,15 +88,15 @@ const CoLeader = ({ value: coLeaders = [], onChange, error }: CoLeaderFieldProps
};

return (
<Container>
<Container ref={containerRef}>
<LeadersContainer>
{/*추가 버튼과 멘션 인풋 */}
{coLeaders.length < 3 && (
<AddLeader>
<AddButton
type={'button'}
onClick={() => {
setShowInput(true);
setShowInput(prev => !prev);
setComment('');
}}
isActive={showInput}
Expand Down
15 changes: 13 additions & 2 deletions src/components/form/SearchMention/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ const SearchMention = ({
<>
<SRenderSuggestion
key={suggestion.id}
onClick={() => handleUserClick(suggestion as mentionableDataType)}
onClick={() => {
handleUserClick(suggestion as mentionableDataType);
}}
onKeyDown={(e: React.KeyboardEvent) => {
//엔터 누르면 간편히 설정되도록 하고 싶은데,
//위에 react-mention의 li(aria-selected 속성 사용)를 조작해야할 것 같아서.. 아직은 구현 못함
Expand Down Expand Up @@ -160,6 +162,7 @@ const SearchMention = ({
onKeyDown={(e: React.KeyboardEvent) => {
if (e.key === 'Enter') {
// 엔터 키를 눌렀을 때 기본 동작(개행) 방지
console.log('hi');
e.preventDefault();
}
}}
Expand All @@ -176,6 +179,13 @@ const SearchMention = ({
return data;
}}
renderSuggestion={renderSuggestion}
// onKeyDown={(e: React.KeyboardEvent) => {
// if (e.key === 'Enter') {
// // 엔터 키를 눌렀을 때 기본 동작(개행) 방지
// console.log('hiss');
// e.preventDefault();
// }
// }}
/>
</MentionsInput>
);
Expand Down Expand Up @@ -206,6 +216,7 @@ const FeedModalMentionStyle = {
boxSizing: 'border-box',
},
input: {
//요 부분이 textArea!
color: colors.gray50,
innerHeight: '0',
borderRadius: '10px',
Expand All @@ -217,6 +228,7 @@ const FeedModalMentionStyle = {
boxSizing: 'border-box',
overflow: 'auto',
width: '100%',
height: '30px',
maxHeight: '208px',
overscrollBehavior: 'none',
fontFamily: 'inherit',
Expand All @@ -225,7 +237,6 @@ const FeedModalMentionStyle = {
lineHeight: 'inherit',
},
highlighter: {
color: colors.success,
innerHeight: '0',
border: 'none',
padding: '0',
Expand Down
11 changes: 6 additions & 5 deletions src/components/page/meetingDetail/MeetingController/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,20 @@ const MeetingController = ({
};

const handleApplicationModal = () => {
if (!me?.hasActivities) {
handleProfileModalOpen();
return;
}
if (!isApplied) {
ampli.clickRegisterGroup({ user_id: Number(me.orgId) });
ampli.clickRegisterGroup({ user_id: Number(me?.orgId) });
//handleDefaultModalOpen();
//setModalTitle('모임 신청하기');
handleApplicationButton('No resolution');

return;
}

if (!me?.hasActivities) {
handleProfileModalOpen();
return;
}

const dialogOption: DialogOptionType = {
title: '신청을 취소하시겠습니까?',
description: '',
Expand Down

0 comments on commit c130de6

Please sign in to comment.