transform core api codes into this project, update modules as admin/pos context modules
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'
|
||||
import { CreateUserDto, UpdateUserDto } from './dto/user.dto'
|
||||
import { AdminUsersService } from './users.service'
|
||||
|
||||
@Controller('admin/users')
|
||||
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: any) {
|
||||
return this.usersService.create(data as CreateUserDto)
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async update(@Param('id') id: string, @Body() data: any) {
|
||||
return this.usersService.update(id, data as UpdateUserDto)
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return this.usersService.delete(id)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user