rename function
This commit is contained in:
@@ -57,7 +57,7 @@ class Wiass_REST_Delivery_Process_API {
|
|||||||
|
|
||||||
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)', array(
|
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)', array(
|
||||||
'methods' => 'POST',
|
'methods' => 'POST',
|
||||||
'callback' => array(__CLASS__, 'update_customer_acceptance'),
|
'callback' => array(__CLASS__, 'submit_customer_acceptance'),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)/upload-file' , array(
|
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)/upload-file' , array(
|
||||||
@@ -151,7 +151,7 @@ class Wiass_REST_Delivery_Process_API {
|
|||||||
return new WP_REST_Response($result);
|
return new WP_REST_Response($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function update_customer_acceptance($data){
|
public static function submit_customer_acceptance($data){
|
||||||
if (!is_user_logged_in()){
|
if (!is_user_logged_in()){
|
||||||
return self::generate_error('You don\'t have permission to read this entry', 401);
|
return self::generate_error('You don\'t have permission to read this entry', 401);
|
||||||
}
|
}
|
||||||
@@ -300,9 +300,6 @@ class Wiass_REST_Delivery_Process_API {
|
|||||||
return new WP_REST_Response ($result);
|
return new WP_REST_Response ($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Helper function
|
//Helper function
|
||||||
private static function generate_error($message, $code = 500){
|
private static function generate_error($message, $code = 500){
|
||||||
$error = array(
|
$error = array(
|
||||||
|
|||||||
Reference in New Issue
Block a user