feat(pos): add update password functionality with DTO and service method
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { PosInfo } from '@/common/decorators/posInfo.decorator'
|
||||
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Controller, Get, Res } from '@nestjs/common'
|
||||
import { Body, Controller, Get, Put, Res } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import type {
|
||||
PosServiceGetAccessibleResponseDto,
|
||||
PosServiceGetInfoResponseDto,
|
||||
PosServiceGetMeResponseDto,
|
||||
} from './dto/pos-response.dto'
|
||||
import { UpdatePosAccountPasswordDto } from './dto/update-password-request.dto'
|
||||
import { PosService } from './pos.service'
|
||||
|
||||
@ApiTags('Pos')
|
||||
@@ -48,4 +49,13 @@ export class PosController {
|
||||
): Promise<PosServiceGetMeResponseDto> {
|
||||
return await this.service.getMe(account_id, pos_id)
|
||||
}
|
||||
|
||||
@Put('update-password')
|
||||
async updatePassword(
|
||||
@TokenAccount('userId') consumerId: string,
|
||||
@TokenAccount('account_id') accountId: string,
|
||||
@Body() data: UpdatePosAccountPasswordDto,
|
||||
) {
|
||||
return this.service.updatePassword(consumerId, accountId, data)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user