Skip to content

Commit

Permalink
added clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmm20 committed Mar 21, 2024
1 parent ac13f8f commit eb6ac1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/pages/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ export default function HomePage() {

const getAuctions = async () => {
try {
// get auction list
const response = await fetchData({
endpoint: 'auctions/',
method: 'GET',
});

// get items associated with each auction
const itemsPromises = response.data.map(async (auction) => {
const itemResponse = await fetchData({
endpoint: `auctions/${auction.id}/vehicles/`,
Expand All @@ -50,7 +52,7 @@ export default function HomePage() {
});

const auctionsWithItems = await Promise.all(itemsPromises);

const auctionList = sortAuctions(auctionsWithItems);
setUpcomingAuctionList(auctionList.upcoming);
setCurrentAuctionList(auctionList.current);
Expand Down

0 comments on commit eb6ac1e

Please sign in to comment.