fix(backend): rendering issue

This commit is contained in:
2025-01-19 21:11:38 +01:00
parent 5fac6de05a
commit 463141981b
7 changed files with 635 additions and 16 deletions

View File

@@ -93,10 +93,13 @@ async function extractUsingAI(
const recipe = await openai.extractRecipe(markdown);
if (isValidRecipe(recipe)) {
return recipe;
if (recipe) {
if ("errorMessages" in recipe) {
throw new Error("Failed to extract recipe: " + recipe.errorMessages[0]);
} else {
return recipe;
}
}
return;
}
async function processCreateRecipeFromUrl(
@@ -172,13 +175,6 @@ async function processCreateRecipeFromUrl(
}
}
if (!recipe) {
console.error("Failed to parse recipe");
streamResponse.enqueue("failed to parse recipe");
streamResponse.cancel();
return;
}
const newRecipe: Recipe = {
type: "recipe",
id,

View File

@@ -51,10 +51,12 @@ export default async function Greet(
</PageHero.Subline>
</PageHero.Footer>
</PageHero>
<Recommendations
id={movie.id}
type="movie"
/>
{false && (
<Recommendations
id={movie.id}
type="movie"
/>
)}
{movie.tags.length > 0 && (
<>
<br />