feat(SPG-1236): implement otp checker guard on active and confirm user
parent
de43f0f28b
commit
822cfe606a
|
@ -6,6 +6,7 @@ import {
|
|||
Patch,
|
||||
Post,
|
||||
Put,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { UserDataOrchestrator } from '../domain/usecases/user-data.orchestrator';
|
||||
import { UserDto } from './dto/user.dto';
|
||||
|
@ -17,6 +18,7 @@ import { BatchIdsDto } from 'src/core/modules/infrastructure/dto/base-batch.dto'
|
|||
import { Public } from 'src/core/guards';
|
||||
import { UpdateUserDto } from './dto/update-user.dto';
|
||||
import { UpdatePasswordUserDto } from './dto/update-password-user.dto';
|
||||
import { OtpCheckerGuard } from 'src/core/guards/domain/otp-checker.guard';
|
||||
|
||||
@ApiTags(`${MODULE_NAME.USER.split('-').join(' ')} - data`)
|
||||
@Controller(`v1/${MODULE_NAME.USER}`)
|
||||
|
@ -36,25 +38,23 @@ export class UserDataController {
|
|||
}
|
||||
|
||||
@Patch(':id/active')
|
||||
// TODO => simpan OTP update yang disikim dari request ini
|
||||
@UseGuards(OtpCheckerGuard)
|
||||
async active(@Param('id') dataId: string): Promise<string> {
|
||||
return await this.orchestrator.active(dataId);
|
||||
}
|
||||
|
||||
@Put('/batch-active')
|
||||
// TODO => simpan OTP update yang disikim dari request ini
|
||||
async batchActive(@Body() body: BatchIdsDto): Promise<BatchResult> {
|
||||
return await this.orchestrator.batchActive(body.ids);
|
||||
}
|
||||
|
||||
@Patch(':id/confirm')
|
||||
// TODO => simpan OTP update yang disikim dari request ini
|
||||
@UseGuards(OtpCheckerGuard)
|
||||
async confirm(@Param('id') dataId: string): Promise<string> {
|
||||
return await this.orchestrator.confirm(dataId);
|
||||
}
|
||||
|
||||
@Put('/batch-confirm')
|
||||
// TODO => simpan OTP update yang disikim dari request ini
|
||||
async batchConfirm(@Body() body: BatchIdsDto): Promise<BatchResult> {
|
||||
return await this.orchestrator.batchConfirm(body.ids);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue