Skip to content

Bug (Suggestion)  #5

@kevparang

Description

@kevparang

Seems like the app it generates a foodName without the actual food name.
For example:
const foodName = 3 + ; // Replace with the food you want to search for
const apiUrl = https://trackapi.nutritionix.com/v2/search/instant?query=${foodName};
const headers = {
"x-app-id": app_id,
"x-app-key": app_key,
"x-remote-user-id": 0
};
fetch(apiUrl, { headers })
.then((response) => {
if (response.status === 200) {
return response.json();
} else {
throw new Error(Error: HTTP response code ${response.status});
}
})
.then((data) => {
console.log(data);
})
.catch((error) => {
console.error("Error:", error);
});

![image](https://github.com/KyleWynne/Health_Blocks/assets/44794498/245a4b64-43ba-45af-b5b8-978a9fb1fe92)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions