@@ -30,7 +30,7 @@ export function usePostEditData(id: string, userId: string | undefined) {
3030}
3131
3232// 게시글 업데이트 기능
33- export function useUpdatePost ( id : string , accessToken : string ) {
33+ export function useUpdatePost ( id : string ) {
3434 const router = useRouter ( ) ;
3535 const queryClient = useQueryClient ( ) ;
3636
@@ -44,7 +44,7 @@ export function useUpdatePost(id: string, accessToken: string) {
4444 return axiosInstance . put (
4545 `${ API_URLS . POSTS } /${ id } ` ,
4646 { title, content } ,
47- { headers : { Authorization : `Bearer ${ accessToken } ` } }
47+ { headers : { requiresAuth : true } }
4848 ) ;
4949 } ,
5050 onSuccess : ( ) => {
@@ -60,7 +60,7 @@ export function useUpdatePost(id: string, accessToken: string) {
6060}
6161
6262// 게시글 삭제 기능
63- export function useDeletePost ( id : string , accessToken : string ) {
63+ export function useDeletePost ( id : string ) {
6464 const router = useRouter ( ) ;
6565 const queryClient = useQueryClient ( ) ;
6666
@@ -71,7 +71,7 @@ export function useDeletePost(id: string, accessToken: string) {
7171 }
7272
7373 return axiosInstance . delete ( `${ API_URLS . POSTS } /${ id } ` , {
74- headers : { Authorization : `Bearer ${ accessToken } ` }
74+ headers : { requiresAuth : true }
7575 } ) ;
7676 } ,
7777 onSuccess : ( ) => {
@@ -86,13 +86,13 @@ export function useDeletePost(id: string, accessToken: string) {
8686 } ) ;
8787}
8888
89- export const usePostEdit = ( id : string , userId : string | undefined , accessToken : string ) => {
89+ export const usePostEdit = ( id : string , userId : string | undefined ) => {
9090 const [ title , setTitle ] = useState ( '' ) ;
9191 const [ content , setContent ] = useState ( '' ) ;
9292
9393 const { data } = usePostEditData ( id , userId ) ;
94- const updatePostMutation = useUpdatePost ( id , accessToken ) ;
95- const deletePostMutation = useDeletePost ( id , accessToken ) ;
94+ const updatePostMutation = useUpdatePost ( id ) ;
95+ const deletePostMutation = useDeletePost ( id ) ;
9696
9797 useEffect ( ( ) => {
9898 if ( data ) {
0 commit comments