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
                 else $article["generic"] = $product["generic_name"];
93
                 else $article["generic"] = $product["generic_name"];
94
             }
94
             }
95
             else {
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
             array_push($formatted_articles, $article);
100
             array_push($formatted_articles, $article);
101
         }
101
         }
103
         return $formatted_articles;
103
         return $formatted_articles;
104
     }
104
     }
105
 
105
 
106
-    private function get_openfoodfacts_product($barcode){
106
+    private function get_openfoodfacts_product($barcode)
107
+    {
107
         $country = 'fr';
108
         $country = 'fr';
108
         $productSlug = 'produit';
109
         $productSlug = 'produit';
109
         $url = 'https://{country}.openfoodfacts.org/api/v0/{product}/{scan}.json';
110
         $url = 'https://{country}.openfoodfacts.org/api/v0/{product}/{scan}.json';

Loading…
Cancel
Save