update pos consumer module
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { AccountsService } from './accounts.service'
|
||||
@@ -9,7 +10,7 @@ export class AccountsController {
|
||||
constructor(private readonly accountsService: AccountsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Param('consumerId') consumerId: string) {
|
||||
async findAll(@TokenAccount('userId') consumerId: string) {
|
||||
return this.accountsService.findAll(consumerId)
|
||||
}
|
||||
|
||||
@@ -20,7 +21,7 @@ export class AccountsController {
|
||||
|
||||
@Post()
|
||||
async create(
|
||||
@Param('consumerId') consumerId: string,
|
||||
@TokenAccount('userId') consumerId: string,
|
||||
@Body() data: CreateConsumerAccountDto,
|
||||
) {
|
||||
return this.accountsService.create(consumerId, data)
|
||||
|
||||
@@ -72,8 +72,8 @@ export class AccountsService {
|
||||
return ResponseMapper.update(account)
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
await this.prisma.account.delete({ where: { id } })
|
||||
return ResponseMapper.delete()
|
||||
}
|
||||
// async delete(id: string) {
|
||||
// await this.prisma.account.delete({ where: { id } })
|
||||
// return ResponseMapper.delete()
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ export class ConsumerComplexGoodsController {
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
) {
|
||||
console.log(userId, businessActivityId, complexId)
|
||||
|
||||
return this.service.findAll(userId, businessActivityId, complexId)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user