import { Controller, Post, Param, UseGuards, Req } from '@nestjs/common';
import { Request } from 'express';
import { ForgeService } from './forge.service';
import { AuthGuard } from '../auth/guards/auth.guard';
import { User } from '../user/user.entity';

@Controller('forge')
@UseGuards(AuthGuard)
export class ForgeController {
  constructor(private readonly forgeService: ForgeService) {}

  @Post('upgrade/:charItemId')
  upgrade(@Param('charItemId') charItemId: string, @Req() req: Request & { user: User }) {
    return this.forgeService.upgradeItem(charItemId, req.user);
  }
}
