create user class and make use of it

This commit is contained in:
GotPPay
2018-09-11 09:27:20 +02:00
committed by Bilal Catic
parent aae23e4ea3
commit d26569a8be
2 changed files with 46 additions and 15 deletions

View File

@@ -8,6 +8,10 @@ class Wiass_REST_User_API {
*/
private static $namespace = 'wiaas';
public function __construct() {
include_once dirname( __FILE__ ) . '/user/class-wiaas-user-profile.php';
}
public static function register_routes() {
register_rest_route( self::$namespace, 'user/validate-token', array(
@@ -39,21 +43,8 @@ class Wiass_REST_User_API {
}
public static function get_countries(){
$result = [
array(
'idCountry' => '1',
'countryName' => 'Sweden'
),
array(
'idCountry' => '2',
'countryName' => 'Finland'
),
array(
'idCountry' => '3',
'countryName' => 'Denmark'
)
];
$countries = Wiaas_User_Profile::get_list_of_countries();
return new WP_REST_Response($result);
return new WP_REST_Response($countries);
}
}