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 f33dd17..9cd5c42 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 @@ -119,7 +119,7 @@ class Wiass_REST_Delivery_Process_API { } $entry = GFAPI::get_entry($data['entry_id']); - if (!$entry){ + if (is_wp_error($entry)){ return self::generate_error('Customer acceptance entry not found', 404); } @@ -153,12 +153,12 @@ class Wiass_REST_Delivery_Process_API { public static function submit_customer_acceptance($data){ 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 update this entry', 401); } $entry = GFAPI::get_entry($data['entry_id']); - if (!$entry){ - return self::generate_wiaas_response('INTERNAL_SERVER_ERROR', 'error'); + if (is_wp_error($entry)){ + return self::generate_error('Customer acceptance entry not found', 404); } $status = $_POST['actionType'];