refactor user accounts structure
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { AdminUsersService } from './consumers.service'
|
||||
import { CreateConsumerDto, UpdateConsumerDto } from './dto/consumer.dto'
|
||||
|
||||
@Controller('admin/consumers')
|
||||
export class AdminUsersController {
|
||||
constructor(private readonly usersService: AdminUsersService) {}
|
||||
|
||||
@Get()
|
||||
async findAll() {
|
||||
return this.usersService.findAll()
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id') id: string) {
|
||||
return this.usersService.findOne(id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() data: CreateConsumerDto) {
|
||||
return this.usersService.create(data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateConsumerDto) {
|
||||
return this.usersService.update(id, data)
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return this.usersService.delete(id)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user