2026-03-11 20:42:34 +03:30
|
|
|
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
2026-03-07 11:25:11 +03:30
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-11 20:42:34 +03:30
|
|
|
@Patch(':id')
|
2026-03-07 11:25:11 +03:30
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|