diff --git a/src/users/controllers/user-items.controller.ts b/src/users/controllers/user-items.controller.ts index 854c602..329b5de 100644 --- a/src/users/controllers/user-items.controller.ts +++ b/src/users/controllers/user-items.controller.ts @@ -8,7 +8,7 @@ import { HttpCode, } from '@nestjs/common'; import { UserItemsService } from '../services/user-items.service'; -import { BuyItemDto } from '../dtos/buy-item.dto'; +import { CreateItemDto } from '../dtos/create-item.dto'; import { EquipItemDto } from '../dtos/equip-item.dto'; import { ApiTags } from '@nestjs/swagger'; import { PositiveIntPipe } from 'src/common/pipes/positive-int/positive-int.pipe'; @@ -33,10 +33,10 @@ export class UserItemsController { @HttpCode(201) async buyItem( @Param('userId', PositiveIntPipe) userId: number, - @Body() buyItemDto: BuyItemDto, + @Body() createItemDto: CreateItemDto, ) { - buyItemDto.userId = userId; - return await this.userItemsService.buyItem(buyItemDto); + createItemDto.userId = userId; + return await this.userItemsService.buyItem(createItemDto); } @Patch() diff --git a/src/users/dtos/buy-item.dto.ts b/src/users/dtos/create-item.dto.ts similarity index 82% rename from src/users/dtos/buy-item.dto.ts rename to src/users/dtos/create-item.dto.ts index d73c6c3..128fca7 100644 --- a/src/users/dtos/buy-item.dto.ts +++ b/src/users/dtos/create-item.dto.ts @@ -1,5 +1,5 @@ import { IsArray, IsInt } from 'class-validator'; -export class BuyItemDto { +export class CreateItemDto { @IsInt() userId: number;