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