diff --git a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php index 9cd5c42..76cb9d9 100644 --- a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php +++ b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php @@ -33,22 +33,12 @@ class Wiass_REST_Delivery_Process_API { 'callback' => array(__CLASS__, 'get_customer_acceptance'), ) ); - /* - - Used for some fast test and check - - register_rest_route( self::$namespace, 'gravity-form-entry/(?P\d+)/field/(?P\d+(.\d+)?)', array( - 'methods' => 'GET', - 'callback' => array(__CLASS__, 'get_field_value_from_entry'), - ) ); - - */ - register_rest_route( self::$namespace, 'gravity-form-entry/(?P\d+)', array( 'methods' => 'GET', 'callback' => array(__CLASS__, 'get_form_entry'), ) ); + //Used for testing register_rest_route( self::$namespace, 'gravity-form-entry/(?P\d+)', array( 'methods' => 'PUT', 'callback' => array(__CLASS__, 'update_entry'), @@ -266,26 +256,13 @@ class Wiass_REST_Delivery_Process_API { return self::generate_wiaas_response('NOT_UPLOADED', 'error'); } - //Used for testing and checking - /* - - - public static function get_field_value_from_entry($data){ - //TODO : check for permissions - $entry = GFAPI::get_entry($data['entry_id']); - $result = $entry[$data['field_id']] ?: ''; - return new WP_REST_Response ($result); - } - - */ - - //TODO: Remove this function + //Used for testing public static function get_form_entry($data) { return GFAPI::get_entry($data['entry_id']); } - //TODO: Remove this function + //Used for testing public static function update_entry($data){ $entry = GFAPI::get_entry($data['entry_id']); $new_values = json_decode($data->get_body());