Use POST request for deactivating to handle more plugin names
This commit is contained in:
parent
39254344f2
commit
b52935229e
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue