Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/domains/mypage/components/DeleteAllModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ConfirmModal from '@/shared/components/modal-pop/ConfirmModal';
import { Dispatch, SetStateAction } from 'react';
import useFetchMyBar from '../api/fetchMyBar';
import useFetchAlarm from '../api/fetchAlarm';
import { useToast } from '@/shared/hook/useToast';

interface Props {
open: boolean;
Expand All @@ -11,16 +12,23 @@ interface Props {
}

function DeleteAllModal({ open, onClose, setIsModal, type }: Props) {
const { toastSuccess } = useToast();
const { deleteMyBar } = useFetchMyBar();
const { deleteAlarm } = useFetchAlarm();
const handleBarDelete = () => {
deleteMyBar.mutate(undefined, {
onSuccess: () => setIsModal(false),
onSuccess: () => {
toastSuccess('์„ฑ๊ณต์ ์œผ๋กœ ์‚ญ์ œ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
setIsModal(false);
},
});
};
const handleAlarmDelete = () => {
deleteAlarm.mutate(undefined, {
onSuccess: () => setIsModal(false),
onSuccess: () => {
setIsModal(false);
toastSuccess('์„ฑ๊ณต์ ์œผ๋กœ ์‚ญ์ œ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
},
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/domains/mypage/components/EditNickName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function EditNickName({
value={editNickName}
className="w-full"
/>
<TextButton onClick={handleDefaultNickname}>์ „ ๋‹‰๋„ค์ž„์œผ๋กœ ๋Œ์•„๊ฐ€๊ธฐ</TextButton>
<TextButton onClick={handleDefaultNickname}>์ดˆ๊ธฐํ™”</TextButton>
</div>
</ModalLayout>
);
Expand Down
6 changes: 6 additions & 0 deletions src/domains/mypage/components/pages/my-alarm/MyAlarm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from 'next/link';
import useFetchAlarm from '@/domains/mypage/api/fetchAlarm';
import { useQuery } from '@tanstack/react-query';
import DeleteAllModal from '../../DeleteAllModal';
import { useToast } from '@/shared/hook/useToast';

interface MyAlarm {
createdAt: Date;
Expand All @@ -21,6 +22,7 @@ interface MyAlarm {
}

function MyAlarm() {
const { toastInfo } = useToast();
const [isModal, setIsModal] = useState(false);
const { fetchAlarm } = useFetchAlarm();
const { data } = useQuery({
Expand All @@ -29,6 +31,10 @@ function MyAlarm() {
});

const handleDelete = () => {
if (data.items.length == 0) {
toastInfo('์•„์ง ์•Œ๋ฆผ์ด ์—†์Šต๋‹ˆ๋‹ค.');
return;
}
setIsModal(!isModal);
};

Expand Down
6 changes: 6 additions & 0 deletions src/domains/mypage/components/pages/my-bar/MyBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useState } from 'react';
import DeleteAllModal from '../../DeleteAllModal';
import useFetchMyBar from '@/domains/mypage/api/fetchMyBar';
import { useQuery } from '@tanstack/react-query';
import { useToast } from '@/shared/hook/useToast';

interface MyCocktail {
cocktailId: number;
Expand All @@ -19,6 +20,7 @@ interface MyCocktail {
}

function MyBar() {
const { toastInfo } = useToast();
const [isModal, setIsModal] = useState(false);
const { fetchMyBar } = useFetchMyBar();
const { data } = useQuery({
Expand All @@ -28,6 +30,10 @@ function MyBar() {
});

const handleDelete = () => {
if (data.items.length == 0) {
toastInfo('์ €์žฅํ•œ ์นตํ…Œ์ผ์ด ์—†์Šต๋‹ˆ๋‹ค.');
return;
}
setIsModal(!isModal);
};

Expand Down
58 changes: 0 additions & 58 deletions src/domains/recipe/api/CocktailSearch.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/domains/recipe/api/RecipeFetch.tsx

This file was deleted.

Loading