Skip to content

Commit

Permalink
피드작성이 안떠요 (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
na-reum authored Dec 9, 2023
1 parent 08bbe9e commit 18d38d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/api/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ export const fetchMyProfile = async () => {
};

export const fetchMeetingListOfUserAttend = async () => {
return api.get<PromiseResponse<GroupInfo[]>>('/user/v2/meeting/all');
return api.get<GroupInfo[]>('/user/v2/meeting/all');
};
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function FeedCreateWithSelectMeetingModal({ isModalOpened, handleModalClose }: C
{!isFetchAttendMeetingLoading && (
<FeedFormPresentation
userId={Number(me?.orgId)}
attendGroupsInfo={attendMeetingList?.data.data}
attendGroupsInfo={attendMeetingList?.data}
title="피드 작성"
handleDeleteImage={handleDeleteImage}
handleModalClose={handleModalClose}
Expand Down
22 changes: 17 additions & 5 deletions src/components/modal/FloatingButtonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,32 @@ import FeedIcon from '../../../public/assets/svg/floating_button_feed_icon.svg';
import GroupIcon from '../../../public/assets/svg/floating_button_group_icon.svg';
import NoJoinedGroupModal from './NoJoinedGroupModal';

const FloatingButtonModal = (props: { isActive: boolean }) => {
const { isActive } = props;
const FloatingButtonModal = (props: { isActive: boolean; handleOptionClose: () => void }) => {
const { isActive, handleOptionClose } = props;
const router = useRouter();
const overlay = useOverlay();
const { data: me } = useQueryMyProfile();
const queryClient = useQueryClient();
const { mutate: fetchUserAttendMeetingListMutate } = useMutation(fetchMeetingListOfUserAttend, {
onSuccess: data => {
queryClient.setQueryData(['fetchMeetingList', 'all'], data);
if (data.data.data.length === 0) {
overlay.open(({ isOpen, close }) => <NoJoinedGroupModal isModalOpened={isOpen} handleModalClose={close} />);
if (data.data.length === 0) {
overlay.open(({ isOpen, close }) => (
<NoJoinedGroupModal
isModalOpened={isOpen}
handleModalClose={() => {
close(), handleOptionClose();
}}
/>
));
} else {
overlay.open(({ isOpen, close }) => (
<FeedCreateWithSelectMeetingModal isModalOpened={isOpen} handleModalClose={close} />
<FeedCreateWithSelectMeetingModal
isModalOpened={isOpen}
handleModalClose={() => {
close(), handleOptionClose();
}}
/>
));
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/page/postList/FloatingButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function FloatingButton() {
<OptionOpenButton isActive={isActive} onClick={handleButtonClick}>
<Icon isActive={isActive} />
</OptionOpenButton>
<FloatingButtonModal isActive={isActive} />
<FloatingButtonModal isActive={isActive} handleOptionClose={handleOptionClose} />
</Container>
</>
);
Expand Down

0 comments on commit 18d38d0

Please sign in to comment.