Añadir los parametros de búsqueda en la api del producto

This commit is contained in:
Jaume Solís 2024-04-11 11:49:30 +02:00
parent 4207584997
commit 63783d1515
1 changed files with 3 additions and 4 deletions

View File

@ -147,11 +147,10 @@ export const useCartStore = defineStore("cart", () => {
routeId.value = id; routeId.value = id;
try { try {
const params = transformOptionsToParams(options); const params = transformOptionsToParams(options);
const promises = [ const promises = [
apiBack.get(`products/${+id - 1}`), apiBack.get(`products/${+id - 1}`, { params }),
apiBack.get(`products/${+id}`), apiBack.get(`products/${+id}`, { params }),
apiBack.get(`products/${+id + 1}`), apiBack.get(`products/${+id + 1}`, { params }),
]; ];
const results = await Promise.allSettled(promises); const results = await Promise.allSettled(promises);
const [prev, current, next] = results.map((res) => { const [prev, current, next] = results.map((res) => {