Skip to content

Commit

Permalink
r
Browse files Browse the repository at this point in the history
  • Loading branch information
Monique Cheng committed Apr 21, 2024
2 parents 5c2b151 + d6d6ff7 commit 85ab6a4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/app/profileScreen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,20 +371,20 @@ export default function Profile() {
const data = await fetchUser();
setUser(data);
}
async function fetchProducts() {
const data = (await arrayOfFavorites()) as Product[];
const mapCategories = await Promise.all(
data.map(async product => {
const updateCategory = await convertButtonNumberToCategory(
product.category,
);
return { ...product, category: updateCategory };
}),
);
setFavorites(mapCategories);
}

useEffect(() => {
async function fetchProducts() {
const data = (await arrayOfFavorites()) as Product[];
const mapCategories = await Promise.all(
data.map(async product => {
const updateCategory = await convertButtonNumberToCategory(
product.category,
);
return { ...product, category: updateCategory };
}),
);
setFavorites(mapCategories);
}
fetchProducts();
fetchOrders();
getUser();
Expand Down

0 comments on commit 85ab6a4

Please sign in to comment.