Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Dec 3, 2024
1 parent 13bc899 commit 678405b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/pages/nutrition/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ export function postRobotoff(config: PostRobotoffParams) {

axios.post(
`${ROBOTOFF_API_URL}/insights/annotate`,
new URLSearchParams(
`insight_id=${insightId}&annotation=2&data=${JSON.stringify({
nutrients: filteredValues,
})}`,
),
{
insight_id: insightId,
annotation: 2,
data: { nutrient: filteredValues },
withCredentials: true,

headers: { "content-type": "application/x-www-form-urlencoded" },
},
{ withCredentials: true },
);
}

Expand All @@ -75,10 +79,7 @@ export function skipRobotoff(config: Pick<PostRobotoffParams, "insightId">) {

axios.post(
`${ROBOTOFF_API_URL}/insights/annotate`,
{
insight_id: insightId,
annotation: -1,
},
new URLSearchParams(`insight_id=${insightId}&annotation=-1`),
{ withCredentials: true },
);
}
Expand All @@ -88,10 +89,7 @@ export function deleteRobotoff(config: Pick<PostRobotoffParams, "insightId">) {

axios.post(
`${ROBOTOFF_API_URL}/insights/annotate`,
{
insight_id: insightId,
annotation: 0,
},
new URLSearchParams(`insight_id=${insightId}&annotation=0`),
{ withCredentials: true },
);
}

0 comments on commit 678405b

Please sign in to comment.