Handle order project and refactor api
This commit is contained in:
@@ -31,7 +31,7 @@ class Wiass_REST_User_API {
|
||||
public static function validate_token() {
|
||||
$user = wp_get_current_user();
|
||||
|
||||
return new WP_REST_Response(array(
|
||||
return rest_ensure_response(array(
|
||||
'userInfo' => array(
|
||||
'wiaas_id_user' => $user->ID,
|
||||
'wiaas_is_company_admin' => 1, //TODO: don't hardcode this
|
||||
@@ -45,6 +45,6 @@ class Wiass_REST_User_API {
|
||||
public static function get_countries(){
|
||||
$countries = Wiaas_Countries::get_list_of_countries();
|
||||
|
||||
return new WP_REST_Response($countries);
|
||||
return rest_ensure_response($countries);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user