File size: 631 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 );
		} );
}