커피챗은 한 개만 오픈할 수 있어요. 커피챗에 대한 설명이 충분히 작성되었는지 확인해주세요.
@@ -28,7 +30,7 @@ export default function SubmitDialog({ isOpen, onClose, onSubmit }: SubmitDialog
취소
@@ -45,7 +47,7 @@ export default function SubmitDialog({ isOpen, onClose, onSubmit }: SubmitDialog
theme='white'
style={{ width: '100%' }}
>
- 오픈하기
+ {uploadType}하기
diff --git a/src/components/coffeechat/upload/CoffeechatForm/UploadButton/index.tsx b/src/components/coffeechat/upload/CoffeechatForm/UploadButton/index.tsx
index 55fe1dd86..f97aa0ff2 100644
--- a/src/components/coffeechat/upload/CoffeechatForm/UploadButton/index.tsx
+++ b/src/components/coffeechat/upload/CoffeechatForm/UploadButton/index.tsx
@@ -1,5 +1,4 @@
import styled from '@emotion/styled';
-import { IconPlus } from '@sopt-makers/icons';
import { Button } from '@sopt-makers/ui';
import Responsive from '@/components/common/Responsive';
@@ -12,12 +11,12 @@ export default function UploadButton({ uploadType }: UploadButtonProp) {
return (
-
-
+
커피챗 {uploadType}하기
diff --git a/src/pages/coffeechat/edit/[id].tsx b/src/pages/coffeechat/edit/[id].tsx
index 39c4d40ac..550437123 100644
--- a/src/pages/coffeechat/edit/[id].tsx
+++ b/src/pages/coffeechat/edit/[id].tsx
@@ -48,12 +48,11 @@ const CoffeechatEdit = () => {
},
{
onSuccess: async () => {
- queryClient.invalidateQueries({
- predicate: (query) => ['getRecentCoffeeChat', 'getMembersCoffeeChat'].includes(query.queryKey[0] as string),
- });
-
+ queryClient.invalidateQueries({ queryKey: ['getRecentCoffeeChat'] });
+ queryClient.invalidateQueries({ queryKey: ['getMembersCoffeeChat'] });
+ queryClient.invalidateQueries({ queryKey: ['getMemberOfMe'] });
queryClient.invalidateQueries({ queryKey: getCoffeechatDetail.cacheKey(memberId) });
- toastOpen({ icon: 'success', content: '커피챗이 오픈됐어요! 경험을 나눠주셔서 감사해요.' });
+ toastOpen({ icon: 'success', content: '커피챗이 수정됐어요! 경험을 나눠주셔서 감사해요.' });
logSubmitEvent('editCoffeechat');
await router.push(playgroundLink.coffeechatDetail(me?.id ?? ''));
},
diff --git a/src/pages/coffeechat/upload.tsx b/src/pages/coffeechat/upload.tsx
index 8ad872f60..a231af21a 100644
--- a/src/pages/coffeechat/upload.tsx
+++ b/src/pages/coffeechat/upload.tsx
@@ -2,9 +2,10 @@ import { DialogOptionType, useDialog, useToast } from '@sopt-makers/ui';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { playgroundLink } from 'playground-common/export';
-import { useEffect, useMemo } from 'react';
+import { useMemo } from 'react';
import { FieldValues } from 'react-hook-form';
+import { getCoffeechatDetail } from '@/api/endpoint/coffeechat/getCoffeechatDetail';
import { uploadCoffeechat } from '@/api/endpoint/coffeechat/uploadCoffeechat';
import { useGetMemberOfMe } from '@/api/endpoint/members/getMemberOfMe';
import { useGetMemberProfileById } from '@/api/endpoint_LEGACY/hooks';
@@ -25,21 +26,6 @@ const CoffeechatUpload = () => {
const { data: me } = useGetMemberOfMe();
const { data: profile } = useGetMemberProfileById(me?.id ?? undefined);
- useEffect(() => {
- me?.hasCoffeeChat &&
- open({
- title: `이미 오픈한 커피챗이 있어요!`,
- description: `커피챗은 한 개만 오픈할 수 있어요. 등록된 커피챗을 삭제한 후 다시 시도해주세요.`,
- type: 'single',
- typeOptions: {
- approveButtonText: '확인',
- buttonFunction: async () => {
- await router.push(playgroundLink.coffeechat());
- },
- },
- });
- }, [me?.hasCoffeeChat]);
-
const sortedSoptActivities = useMemo(() => {
if (!profile?.soptActivities) {
return [];
@@ -74,10 +60,11 @@ const CoffeechatUpload = () => {
},
{
onSuccess: async () => {
- queryClient.invalidateQueries({
- predicate: (query) => ['getRecentCoffeeChat', 'getMembersCoffeeChat'].includes(query.queryKey[0] as string),
- });
+ queryClient.invalidateQueries({ queryKey: ['getRecentCoffeeChat'] });
+ queryClient.invalidateQueries({ queryKey: ['getMembersCoffeeChat'] });
queryClient.invalidateQueries({ queryKey: ['getMemberOfMe'] });
+ queryClient.invalidateQueries({ queryKey: getCoffeechatDetail.cacheKey(String(me?.id)) });
+
logSubmitEvent('openCoffeechat', {
career: memberInfo.career
? Array.isArray(memberInfo.career)
@@ -99,7 +86,7 @@ const CoffeechatUpload = () => {
generation: generations ?? [],
part: part ?? [],
});
- toastOpen({ icon: 'success', content: '커피챗이 오픈됐어요! 경험을 나눠주셔서 감사해요.' });
+ await toastOpen({ icon: 'success', content: '커피챗이 오픈됐어요! 경험을 나눠주셔서 감사해요.' });
await router.push(playgroundLink.coffeechat());
},
onError: (error) => {