validate phone number from frontend
This commit is contained in:
@@ -148,6 +148,10 @@ class Wiaas_REST_Customer_API {
|
|||||||
return wiaas_api_notice('ADD_PHONE_NUMBER', 'error', Wiaas_Customer::get_customer_info($customer_id));
|
return wiaas_api_notice('ADD_PHONE_NUMBER', 'error', Wiaas_Customer::get_customer_info($customer_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!preg_match('/^[\d +]*$/', $phone)){
|
||||||
|
return wiaas_api_notice('INVALID_PHONE_NUMBER', 'error', Wiaas_Customer::get_customer_info($customer_id));
|
||||||
|
};
|
||||||
|
|
||||||
if (!Wiaas_Customer::update_customer_profile_info($customer_id, $first_name, $last_name, $phone)){
|
if (!Wiaas_Customer::update_customer_profile_info($customer_id, $first_name, $last_name, $phone)){
|
||||||
return wiaas_api_notice('PROFILE_NOT_CHANGED', 'warning', Wiaas_Customer::get_customer_info($customer_id));
|
return wiaas_api_notice('PROFILE_NOT_CHANGED', 'warning', Wiaas_Customer::get_customer_info($customer_id));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user