Display bid history for media outlet auctions and fetch bid data
Add a new API endpoint and integrate bid history display into the media outlet auction page. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 069d4324-6c40-4355-955e-c714a50de1ea Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/069d4324-6c40-4355-955e-c714a50de1ea/6XTzcDL
This commit is contained in:
@ -168,6 +168,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/auctions/:id/bids', async (req, res) => {
|
||||
try {
|
||||
const bids = await storage.getBidsByAuctionId(req.params.id);
|
||||
res.json(bids);
|
||||
} catch (error) {
|
||||
console.error("Error fetching bids:", error);
|
||||
res.status(500).json({ message: "Failed to fetch bids" });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/auctions/:id/bid', isAuthenticated, async (req: any, res) => {
|
||||
try {
|
||||
const userId = req.user.claims.sub;
|
||||
|
||||
Reference in New Issue
Block a user