neptune-back/src/trade/trade.controller.ts
Mathis 8ea217fe9f
Normalize quote usage in imports
Standardized the quote style to double quotes across all TypeScript files for consistency. This includes ".ts" and ".dto" files.
2024-11-12 13:37:29 +01:00

39 lines
819 B
TypeScript

import {
Body,
Controller,
Get,
HttpCode,
HttpStatus,
Post,
UseGuards,
} from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
import { User } from "@prisma/client";
import { JwtGuard } from "src/auth/guard";
import { GetUser } from "../auth/decorator";
import { TradeDto } from "./dto";
import { TradeService } from "./trade.service";
@UseGuards(JwtGuard)
@ApiTags("trade")
@Controller("trade")
export class TradeController {
constructor(private tradeService: TradeService) {}
@Get("/all")
getAllPromoCodes(@GetUser() user: User) {
return this.tradeService.getTrades(user.id);
}
@HttpCode(HttpStatus.CREATED)
@Post("/create")
createPromoCode(
// @GetUser() user: User,
@Body()
dto: TradeDto,
@GetUser() user: User,
) {
return this.tradeService.createTrade(user.id, dto);
}
}