Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
racebedo123 committed Dec 2, 2024
1 parent 31a5f2d commit 41f838e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions routes/embeddedResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,24 @@ router.put(`/${parsed.name}`, async (req, res) => {

newItems.sort((a, b) => b.similarity - a.similarity);

const finalItems = await Promise.all(
newItems.map(async (item) => {
const store = item.store;
// const finalItems = await Promise.all(
// newItems.map(async (item) => {
// const store = item.store;

// Remove the `embedding` field
const { embedding, ...filteredItem } = item;
// // Remove the `embedding` field
// const { embedding, ...filteredItem } = item;

// Call the store API
const response = await axios.put('/getStores', { store });
const data = await response.json();
// // Call the store API
// const response = await axios.put('/getStores', { store });
// const data = await response.json();

// Add store data if needed or return the filtered item
console.log(data);
return { ...filteredItem, storeData: data };
})
);
// // Add store data if needed or return the filtered item
// console.log(data);
// return { ...filteredItem, storeData: data };
// })
// );

res.json(finalItems);
res.json(newItems);

} catch (error) {
console.error(error);
Expand Down

0 comments on commit 41f838e

Please sign in to comment.