Use POST request for deactivating to handle more plugin names

This commit is contained in:
Lourens Schep 2022-03-30 09:53:53 -03:00
parent 39254344f2
commit b52935229e
1 changed files with 5 additions and 6 deletions

View File

@ -35,12 +35,11 @@ export async function deletePlugin( pluginName: string ) {
}
export async function deactivatePlugin( pluginName: string ) {
const response = await httpClient.post(
wpPluginsEndpoint + '/' + pluginName,
{
status: 'inactive',
}
);
const pluginSlug = pluginName.split( '/' )[ 1 ];
const response = await httpClient.post( wpPluginsEndpoint, {
slug: pluginSlug || pluginName,
status: 'inactive',
} );
expect( response.statusCode ).toEqual( 200 );
}