File size: 524 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import wpcom from 'calypso/lib/wp';
import type { ReinstallPluginsResponse } from './types';

/**
 * Calls the API to reinstall all the subscriptions given a site id.
 * @param {number} siteId Site ID.
 * @returns {Promise} Promise object represents the result of the request.
 */
const reinstallPlugins = ( siteId: number ): Promise< ReinstallPluginsResponse > => {
	return wpcom.req.get( {
		path: `/sites/${ siteId }/marketplace/products/reinstall`,
		apiNamespace: 'wpcom/v2',
	} );
};

export default reinstallPlugins;