File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export const deleteSharedPost = async (postId: number) =>
114114 await axios . delete < SuccessBaseDTO > ( `/maru-api/shared/posts/studio/${ postId } ` ) ;
115115
116116export const scrapPost = async ( postId : number ) =>
117- await axios . get < SuccessBaseDTO > (
117+ await axios . post < SuccessBaseDTO > (
118118 `/maru-api/shared/posts/studio/${ postId } /scrap` ,
119119 ) ;
120120
@@ -152,3 +152,8 @@ export const deleteDormitorySharedPost = async (postId: number) =>
152152 await axios . delete < SuccessBaseDTO > (
153153 `/maru-api/shared/posts/dormitory/${ postId } ` ,
154154 ) ;
155+
156+ export const scrapDormitoryPost = async ( postId : number ) =>
157+ await axios . post < SuccessBaseDTO > (
158+ `/maru-api/shared/posts/dormitory/${ postId } /scrap` ,
159+ ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 getDormitorySharedPosts ,
1111 getSharedPost ,
1212 getSharedPosts ,
13+ scrapDormitoryPost ,
1314 scrapPost ,
1415} from './shared.api' ;
1516import {
@@ -435,3 +436,8 @@ export const useDeleteDormitorySharedPost = ({
435436 onSuccess,
436437 onError,
437438 } ) ;
439+
440+ export const useScrapDormitorySharedPost = ( ) =>
441+ useMutation < AxiosResponse < SuccessBaseDTO > , FailureDTO , number > ( {
442+ mutationFn : scrapDormitoryPost ,
443+ } ) ;
You can’t perform that action at this time.
0 commit comments