ticket-auth-project
Version:
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
37 lines (34 loc) • 922 B
text/typescript
import {
Controller,
Get,
Post,
Body,
Param,
Delete,
UseGuards,
} from '@nestjs/common';
import { CreateTicketDto } from './ticket.model';
import { TicketsService } from './tickets.service';
import { JwtAuthGuard } from 'src/auth/jwt-auth.guard';
('tickets')
export class TicketsController {
constructor(private readonly ticketService: TicketsService) {}
(JwtAuthGuard)
()
async createTicket(() createTicketDto: CreateTicketDto) {
return this.ticketService.createTicket(createTicketDto);
}
()
async getAllTickets() {
return this.ticketService.getAllTicket();
}
(':id')
async getTicketById(('id') ticketId: string) {
return this.ticketService.getTicketById(ticketId);
}
(JwtAuthGuard)
(':id')
async deleteTicket(('id') ticketId: string) {
return this.ticketService.deleteTicket(ticketId);
}
}