diff --git a/includes/api.php b/includes/api.php index 7a96031..91b0e9e 100644 --- a/includes/api.php +++ b/includes/api.php @@ -360,12 +360,13 @@ function lhoist_post_rating(WP_REST_Request $request) $cleanDatas = lhoist_sanitize_ratings_datas($datas); lhoist_check_ratings_datas_formats($cleanDatas); + global $wpdb; $datetime = new DateTime("now", new DateTimeZone('Europe/Brussels')); $ratingsDatas = array( - 'comment' => "super", - 'rating' => 3, + 'rating' => $cleanDatas['note'], + 'comment' => $cleanDatas['comment'] ?? '', 'date' => $datetime->format('Y-m-d H:i:s'), ); $table_name = 'wp_app_ratings';