26 lines
820 B
TypeScript
26 lines
820 B
TypeScript
|
|
import { Body, Controller, Param, Patch, Post } from '@nestjs/common'
|
||
|
|
import { ApiTags } from '@nestjs/swagger'
|
||
|
|
import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
||
|
|
import { LicensesService } from './licenses.service'
|
||
|
|
|
||
|
|
@ApiTags('AdminConsumerAccounts')
|
||
|
|
@Controller('admin/consumers/:consumerId/licenses')
|
||
|
|
export class LicensesController {
|
||
|
|
constructor(private readonly service: LicensesService) {}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
async create(@Param('consumerId') consumerId: string, @Body() data: CreateLicenseDto) {
|
||
|
|
return this.service.create(consumerId, data)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
async update(@Param('id') id: string, @Body() data: UpdateLicenseDto) {
|
||
|
|
return this.service.update(id, data)
|
||
|
|
}
|
||
|
|
|
||
|
|
// @Delete(':id')
|
||
|
|
// async delete(@Param('id') id: string) {
|
||
|
|
// return this.service.delete(id)
|
||
|
|
// }
|
||
|
|
}
|