Browse Source

Update Api

docjyJ 3 years ago
parent
commit
6ba1459848
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      classes/postHandler.php

+ 5
- 4
classes/postHandler.php View File

@@ -93,9 +93,9 @@ class PostHandler
93 93
                 else $article["generic"] = $product["generic_name"];
94 94
             }
95 95
             else {
96
-                $article["nutri-score"] = "";
97
-                $article["generic"] = "";
98
-                $article["ingredients"] = "";
96
+                $article["nutri-score"] = null;
97
+                $article["generic"] = null;
98
+                $article["ingredients"] = null;
99 99
             }
100 100
             array_push($formatted_articles, $article);
101 101
         }
@@ -103,7 +103,8 @@ class PostHandler
103 103
         return $formatted_articles;
104 104
     }
105 105
 
106
-    private function get_openfoodfacts_product($barcode){
106
+    private function get_openfoodfacts_product($barcode)
107
+    {
107 108
         $country = 'fr';
108 109
         $productSlug = 'produit';
109 110
         $url = 'https://{country}.openfoodfacts.org/api/v0/{product}/{scan}.json';

Loading…
Cancel
Save