Skip to content

Commit 5b80e2a

Browse files
committed
refact: 훅에 hostChannelId를 인자로 넘기도록 인터페이스 변경
1 parent 76c57ee commit 5b80e2a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/features/host/hook/useHostHook.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import { useMutation } from '@tanstack/react-query';
22
import updateHostInfo from '../api/host';
33
import { UpdateHostChannelInfoRequest } from '../model/host';
4-
import { useParams } from 'react-router-dom';
5-
6-
export const useUpdateHostChannelInfo = () => {
7-
const { id } = useParams();
8-
const hostChannelId = Number(id);
94

5+
export const useUpdateHostChannelInfo = (hostChannelId: number) => {
106
const mutation = useMutation({
117
mutationFn: (dto: UpdateHostChannelInfoRequest) => updateHostInfo(hostChannelId, dto),
128
});

src/pages/menu/ui/myHost/HostEditPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const HostEditPage = () => {
2020

2121
const hostChannelId = Number(id);
2222
const { data: hostInfo } = useHostChannelInfo(hostChannelId);
23-
const { mutate } = useUpdateHostChannelInfo();
23+
const { mutate } = useUpdateHostChannelInfo(hostChannelId);
2424
const queryClient = useQueryClient();
2525

2626
const handeHostInfoClick = () => {

0 commit comments

Comments
 (0)