Implements WC_WCCOM_Site_Installer_Requirements_Check::met_requirements() validation on GET /install

This commit is contained in:
Rommel Castro 2019-10-01 13:45:30 -06:00
parent 6567271840
commit 4fabaed498
No known key found for this signature in database
GPG Key ID: FE943907D8DBEAA8
1 changed files with 5 additions and 0 deletions

View File

@ -84,6 +84,11 @@ class WC_REST_WCCOM_Site_Installer_Controller extends WC_REST_Controller {
* @return bool|WP_Error
*/
public function get_install_state( $request ) {
$requirements_met = WC_WCCOM_Site_Installer_Requirements_Check::met_requirements();
if ( is_wp_error( $requirements_met ) ) {
return $requirements_met;
}
return rest_ensure_response( WC_WCCOM_Site_Installer::get_state() );
}