transform core api codes into this project, update modules as admin/pos context modules
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'
|
||||
import { AccountsService } from './accounts.service'
|
||||
import { CreateAccountDto, UpdateAccountDto } from './dto/account.dto'
|
||||
|
||||
@Controller('admin/partners/:partnerId/accounts')
|
||||
export class AccountsController {
|
||||
constructor(private readonly accountsService: AccountsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Param('partnerId') partnerId: string) {
|
||||
return this.accountsService.findAll(partnerId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id') id: string) {
|
||||
return this.accountsService.findOne(id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Param('partnerId') partnerId: string, @Body() data: CreateAccountDto) {
|
||||
return this.accountsService.create(partnerId, data)
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateAccountDto) {
|
||||
return this.accountsService.update(id, data)
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return this.accountsService.delete(id)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user