fix bug with non existing entry
This commit is contained in:
@@ -119,7 +119,7 @@ class Wiass_REST_Delivery_Process_API {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$entry = GFAPI::get_entry($data['entry_id']);
|
$entry = GFAPI::get_entry($data['entry_id']);
|
||||||
if (!$entry){
|
if (is_wp_error($entry)){
|
||||||
return self::generate_error('Customer acceptance entry not found', 404);
|
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){
|
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 update this entry', 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry = GFAPI::get_entry($data['entry_id']);
|
$entry = GFAPI::get_entry($data['entry_id']);
|
||||||
if (!$entry){
|
if (is_wp_error($entry)){
|
||||||
return self::generate_wiaas_response('INTERNAL_SERVER_ERROR', 'error');
|
return self::generate_error('Customer acceptance entry not found', 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $_POST['actionType'];
|
$status = $_POST['actionType'];
|
||||||
|
|||||||
Reference in New Issue
Block a user