Artteiv's picture
fix: update branch admin
9e8f9e3
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
} from '@nestjs/common';
import { BranchService } from './branch.service.js';
import { CreateBranchDto } from './dto/create-branch.dto.js';
import { UpdateBranchDto } from './dto/update-branch.dto.js';
import { Public } from '../authentication/authentication.decorator.js';
@Public()
@Controller('branchs')
export class BranchController {
constructor(private readonly branchService: BranchService) {}
@Post()
create(@Body() createBranchDto: CreateBranchDto) {
return this.branchService.create(createBranchDto);
}
@Post(':id/restore')
restore(@Param('id') id: string) {
return this.branchService.restore(id);
}
@Get()
async findAll() {
return this.branchService.findAll();
}
@Get(':id')
async findOne(@Param('id') id: string) {
return this.branchService.findOne(id);
}
@Patch(':id')
async update(
@Param('id') id: string,
@Body() updateBranchDto: UpdateBranchDto,
) {
return this.branchService.update(id, updateBranchDto);
}
@Delete(':id')
async remove(@Param('id') id: string) {
return this.branchService.softRemove(id);
}
@Post(':id/menu-items')
async addMenuItemToBranch(@Param('id') id: string) {}
@Get(':id/menu-items')
async getMenuItemWithBranchId(@Param('id') id: string) {}
}