17 lines
649 B
TypeScript
17 lines
649 B
TypeScript
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { JwtAuthGuard, AuthUser } from '../../common/guards/jwt-auth.guard';
|
|
import { PartnerPrimaryGuard } from '../../common/guards/partner-primary.guard';
|
|
import { CurrentUser } from '../../common/decorators/current-user.decorator';
|
|
import { PromoCodeService } from './promo-code.service';
|
|
|
|
@Controller('partner/promo-codes')
|
|
@UseGuards(JwtAuthGuard, PartnerPrimaryGuard)
|
|
export class PartnerPromoCodeController {
|
|
constructor(private readonly service: PromoCodeService) {}
|
|
|
|
@Get()
|
|
list(@CurrentUser() user: AuthUser) {
|
|
return this.service.listForPartner(user.actorId);
|
|
}
|
|
}
|