initial: standalone repo from monorepo split
This commit is contained in:
35
src/users/users.controller.ts
Normal file
35
src/users/users.controller.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Controller, Get, Patch, Param, Body, Query } from '@nestjs/common';
|
||||
import { UsersService } from './users.service';
|
||||
|
||||
@Controller('users')
|
||||
export class UsersController {
|
||||
constructor(private readonly service: UsersService) {}
|
||||
|
||||
@Get()
|
||||
findAll(
|
||||
@Query('search') search?: string,
|
||||
@Query('tenantId') tenantId?: string,
|
||||
@Query('page') page?: number,
|
||||
@Query('limit') limit?: number,
|
||||
) {
|
||||
return this.service.findAll({ search, tenantId, page, limit });
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.service.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(
|
||||
@Param('id') id: string,
|
||||
@Body() dto: { isActive?: boolean; firstName?: string; lastName?: string },
|
||||
) {
|
||||
return this.service.update(id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id/reset-password')
|
||||
resetPassword(@Param('id') id: string, @Body() dto: { password: string }) {
|
||||
return this.service.resetPassword(id, dto.password);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user