Skip to content

Commit b67f838

Browse files
committed
fix: forgot to await bid service responses
1 parent af5b05d commit b67f838

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/routes/auctions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ auctionsRouter.get(
7070
requireAuth,
7171
async (req: Request, res: Response) => {
7272
try {
73-
const bidsInfo = BidsService.getAuctionBids(req.params.id);
73+
const bidsInfo = await BidsService.getAuctionBids(req.params.id);
7474
return res.status(200).json(bidsInfo);
7575
} catch (error) {
7676
console.error('Error fetching auction bids:', error);
@@ -86,7 +86,7 @@ auctionsRouter.post(
8686
async (req: Request, res: Response) => {
8787
try {
8888
const validatedBody = createBidSchema.validateSync(req.body);
89-
const bid = BidsService.createBid(validatedBody);
89+
const bid = await BidsService.createBid(validatedBody);
9090
// Use 201 when a POST request successfully creates a new resource on the server.
9191
return res.status(201).json(bid);
9292
} catch (error) {

0 commit comments

Comments
 (0)