MCPcopy Create free account
hub / github.com/bsoc-bitbyte/busify / OrdersController

Class OrdersController

backend/src/Orders/orders.controller.ts:14–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12import {Request} from 'src/types';
13@Controller('orders')
14export class OrdersController {
15 constructor(private readonly ordersService: OrdersService) {}
16 @UseGuards(JwtAuthGuard)
17 @Post('/create')
18 async createOrder(@Req() request: Request) {
19 return this.ordersService.createOrder(
20 request.body.scheduleId,
21 request.body.ticketQuantity,
22 request.user.id
23 );
24 }
25
26 @UseGuards(JwtAuthGuard)
27 @Get('/recent')
28 async getRecentOrders() {
29 try {
30 const orders = await this.ordersService.getRecentOrders();
31 return orders;
32 } catch (error) {
33 if (error instanceof HttpException) {
34 throw new HttpException(error.message, error.getStatus());
35 }
36 }
37 }
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected