bugfix(recipeStore): solucionado error al obtener la receta

parent b3f4568f
Showing with 3 additions and 4 deletions
......@@ -9,7 +9,6 @@ export const useRecipeStore = defineStore('recipe', {
pageSize: 6,
totalElements: 0,
totalPages: 0,
//sortBy: 'createdAt',
sortDirection: 'desc'
}),
actions: {
......@@ -21,7 +20,6 @@ export const useRecipeStore = defineStore('recipe', {
this.totalPages = response.totalPages;
this.currentPage = response.number;
this.pageSize = size;
//this.sortBy = sortBy;
this.sortDirection = sortDirection;
} catch (error) {
console.error('Error al obtener la lista de recetas:', error);
......@@ -47,9 +45,10 @@ export const useRecipeStore = defineStore('recipe', {
},
async readDetail(id) {
try {
const response = await recipeService.readDetail(id);
this.recipe = response.content;
const data = await recipeService.readDetail(id);
this.recipe = data;
} catch (error) {
console.error('Error al obtener los detalles de la receta:', error);
this.recipe = null;
throw error;
}
......
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