File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
components/ViewPackagePage/components Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ export default function PackageHeader({
6565
6666 const handleForkClick = async ( ) => {
6767 if ( ! packageInfo ?. package_id || ! isLoggedIn ) return
68- await forkPackage ( packageInfo . package_id )
68+ await forkPackage ( {
69+ packageId : packageInfo . package_id ,
70+ isPrivate,
71+ } )
6972 }
7073
7174 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -15,11 +15,18 @@ export const useForkPackageMutation = ({
1515
1616 return useMutation (
1717 [ "forkPackage" ] ,
18- async ( packageId : string ) => {
18+ async ( {
19+ packageId,
20+ isPrivate,
21+ } : {
22+ packageId : string
23+ isPrivate ?: boolean
24+ } ) => {
1925 if ( ! session ) throw new Error ( "No session" )
2026
2127 const { data } = await axios . post ( "/packages/fork" , {
2228 package_id : packageId ,
29+ is_private : isPrivate ,
2330 } )
2431
2532 const forkedPackage : Package = data . package
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export const useForkPackageMutation = ({
2525
2626 const { data } = await axios . post ( "/packages/fork" , {
2727 package_id : pkg ?. package_id ,
28+ is_private : pkg ?. is_private ,
2829 } )
2930 return data . package
3031 } ,
You can’t perform that action at this time.
0 commit comments