perf(CreateRecipe): cambio de redirección al crear receta hacia el detalle de la misma

parent 1e334571
......@@ -57,6 +57,7 @@ export const useRecipeStore = defineStore('recipe', {
try {
const newRecipe = await recipeService.create(recipeData);
this.recipe = newRecipe;
return newRecipe.id;
} catch (error) {
console.error('Error al crear la receta:', error);
throw error;
......
......@@ -154,8 +154,8 @@ async function handleCreation() {
formData.append(`steps[${index}].description`, step.description);
});
await recipeStore.create(formData);
router.push('/recipes');
const newRecipeId = await recipeStore.create(formData);
router.push(`/recipes/detail/${newRecipeId}`);
} catch (error) {
// Limpia la imagen y el campo del formulario
picture.value = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment