diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index c6a6e270..56f785ac 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -63,7 +63,7 @@ $routes->post('/en/wrench/api/v1/stepresetpass', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/starttopup', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/topupresult', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/preferences', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/preferences', 'WrenchGeneralData::usersPreferences'); // 'WrenchApi::apigate' $routes->post('/en/wrench/api/v1/setpreferences', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchGeneralData.php b/www-api/app/Controllers/WrenchGeneralData.php index 9111d1f5..34d50d9e 100644 --- a/www-api/app/Controllers/WrenchGeneralData.php +++ b/www-api/app/Controllers/WrenchGeneralData.php @@ -9,6 +9,12 @@ class WrenchGeneralData extends BaseController } +// case 'preferences': +// $in["action"] = WRENCHBOARD_ACCOUNT_PREFERENCES; +// //preferences // define('WRENCHBOARD_ACCOUNT_PREFERENCES', 11065); +// break; + + public function signUpCountry(){ $in["action"] = WRENCHBOARD_SIGNUP_COUNTRY; $endpoint = "SIGNUP_COUNTRY-"; @@ -23,7 +29,16 @@ class WrenchGeneralData extends BaseController } public function usersPreferences(){ - //preferences + $in["action"] = WRENCHBOARD_ACCOUNT_PREFERENCES; + $endpoint = "USER_PREFERENCES"; + + $out = $this->getCache($endpoint); // try find in cache + if ( empty($out) || !is_array($out)){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + $this->saveCache($endpoint,$out,25000); + } + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); } } \ No newline at end of file