Download wp-calypso/client/data/media/use-delete-media-mutation.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 310 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/media/use-delete-media-mutation.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/data/media/use-delete-media-mutation.js
-
curl -L -o use-delete-media-mutation.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/media/use-delete-media-mutation.js
310 Bytes
| import { useMutation } from '@tanstack/react-query'; | |
| import wp from 'calypso/lib/wp'; | |
| export const useDeleteMediaMutation = ( queryOptions = {} ) => { | |
| return useMutation( { | |
| ...queryOptions, | |
| mutationFn: ( { siteId, mediaId } ) => | |
| wp.req.post( `/sites/${ siteId }/media/${ mediaId }/delete` ), | |
| } ); | |
| }; | |