Styling fix

This commit is contained in:
moon 2022-04-15 06:51:12 -07:00
parent c3ad996eb2
commit 9aaf994638
1 changed files with 93 additions and 87 deletions

View File

@ -67,7 +67,8 @@ class WCA_Test_Helper_Rest_Api_Filters {
$replacement = true;
}
self::update( function( $filters ) use (
self::update(
function ( $filters ) use (
$endpoint,
$dot_notation,
$replacement
@ -79,7 +80,8 @@ class WCA_Test_Helper_Rest_Api_Filters {
'enabled' => true,
);
return $filters;
});
}
);
return new WP_REST_RESPONSE(null, 204);
}
@ -90,20 +92,24 @@ class WCA_Test_Helper_Rest_Api_Filters {
}
public static function delete( $request ) {
self::update(function($filters) use ($request) {
self::update(
function ( $filters ) use ( $request ) {
array_splice($filters, $request->get_param('index'), 1);
return $filters;
});
}
);
return new WP_REST_RESPONSE(null, 204);
}
public static function toggle( $request ) {
self::update(function($filters) use ($request) {
self::update(
function ( $filters ) use ( $request ) {
$index = $request->get_param('index');
$filters[$index]['enabled'] = !$filters[$index]['enabled'];
return $filters;
});
}
);
return new WP_REST_RESPONSE(null, 204);
}
}