mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 21:59:40 +00:00
refactor: handle kyc journey for customers
This commit is contained in:
32
src/user/controllers/user.controller.ts
Normal file
32
src/user/controllers/user.controller.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import { Body, Controller, Headers, HttpCode, HttpStatus, Patch, Post, UseGuards } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { IJwtPayload } from '~/auth/interfaces';
|
||||
import { DEVICE_ID_HEADER } from '~/common/constants';
|
||||
import { AuthenticatedUser, Public } from '~/common/decorators';
|
||||
import { AccessTokenGuard } from '~/common/guards';
|
||||
import { SetInternalPasswordRequestDto, UpdateNotificationsSettingsRequestDto } from '../dtos/request';
|
||||
import { UserService } from '../services';
|
||||
|
||||
@Controller('users')
|
||||
@ApiTags('Users')
|
||||
@UseGuards(AccessTokenGuard)
|
||||
@ApiBearerAuth()
|
||||
export class UserController {
|
||||
constructor(private userService: UserService) {}
|
||||
|
||||
@Patch('notifications-settings')
|
||||
async updateNotificationSettings(
|
||||
@AuthenticatedUser() user: IJwtPayload,
|
||||
@Body() data: UpdateNotificationsSettingsRequestDto,
|
||||
@Headers(DEVICE_ID_HEADER) deviceId: string,
|
||||
) {
|
||||
return this.userService.updateNotificationSettings(user.sub, data, deviceId);
|
||||
}
|
||||
|
||||
@Post('internal/set-password')
|
||||
@Public()
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
async setPassword(@Body() data: SetInternalPasswordRequestDto) {
|
||||
return this.userService.setCheckerPassword(data);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user