Skip to content

Commit

Permalink
Modified API response to return tickets that are available to book (u…
Browse files Browse the repository at this point in the history
…nreserved Tickets).
  • Loading branch information
alwinsimon committed Oct 27, 2023
1 parent 078bf54 commit c004a94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tickets/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Ticket } from "../models/ticket";
const router = express.Router();

router.get("/api/tickets", async (req: Request, res: Response) => {
const tickets = await Ticket.find({});

// Fetch all Tickets that are available to make a booking (ie, which are not reserved by any order)
const tickets = await Ticket.find({orderId: undefined});

res.send(tickets);
});
Expand Down

0 comments on commit c004a94

Please sign in to comment.