Files
psp_api/src/modules/partners/partners.controller.ts
T

28 lines
893 B
TypeScript
Raw Normal View History

import { PartnerInfo } from '@/common/decorators/partnerInfo.decorator'
import type { IPartnerPayload } from '@/common/models/partnerPayload.model'
import { Controller, Get, Patch } from '@nestjs/common'
2026-04-13 15:47:59 +03:30
import { ApiTags } from '@nestjs/swagger'
import { UpdatePartnerProfileDto } from './dto/partner.dto'
2026-04-13 15:47:59 +03:30
import { PartnerService } from './partners.service'
@ApiTags('Partner')
@Controller('partner')
export class PartnerController {
constructor(private service: PartnerService) {}
@Get('')
async me(@PartnerInfo() { id, account_id }: IPartnerPayload) {
return this.service.me(id, account_id)
}
@Get('info')
async getInfo(@PartnerInfo('id') partnerId: string) {
return this.service.getInfo(partnerId)
}
@Patch('profile')
async update(@PartnerInfo('id') partnerId: string, data: UpdatePartnerProfileDto) {
return this.service.updateInfo(partnerId, data)
2026-04-13 15:47:59 +03:30
}
}