react-code-dataset / wp-calypso /client /sites /settings /administration /tools /restore-plan-software /index.js
react-code-dataset / wp-calypso /client /sites /settings /administration /tools /restore-plan-software /index.js
Download wp-calypso/client/sites/settings/administration/tools/restore-plan-software/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sites/settings/administration/tools/restore-plan-software/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/sites/settings/administration/tools/restore-plan-software/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sites/settings/administration/tools/restore-plan-software/index.js
631 Bytes
| import { stripHTML } from 'calypso/lib/formatting/strip-html'; | |
| import wpcom from 'calypso/lib/wp'; | |
| export function requestRestore( { siteId, successNotice, errorNotice, translate } ) { | |
| wpcom.req | |
| .post( { | |
| path: `/sites/${ siteId }/hosting/restore-plan-software`, | |
| apiNamespace: 'wpcom/v2', | |
| } ) | |
| .then( () => { | |
| successNotice( | |
| translate( 'Requested restoration of plugins and themes that come with your plan.' ) | |
| ); | |
| } ) | |
| .catch( ( error ) => { | |
| const message = | |
| stripHTML( error.message ) || | |
| translate( 'Failed to request restoration of plan plugin and themes.' ); | |
| errorNotice( message ); | |
| } ); | |
| } | |