feat(goods): add editable custom products
This commit is contained in:
@@ -22,6 +22,10 @@ import { UpdateGoodDto } from './dto/update-good.dto';
|
||||
import { QueryGoodDto } from './dto/query-good.dto';
|
||||
import { BatchCreateGoodDto } from './dto/batch-create-good.dto';
|
||||
import { BatchPriorityDto } from './dto/batch-priority.dto';
|
||||
import {
|
||||
CreateCustomGoodDto,
|
||||
UpdateCustomGoodContentDto,
|
||||
} from './dto/custom-good.dto';
|
||||
|
||||
@ApiTags('goods')
|
||||
@ApiBearerAuth()
|
||||
@@ -54,6 +58,21 @@ export class GoodsController {
|
||||
return this.service.batchCreate(dto);
|
||||
}
|
||||
|
||||
@Post('custom')
|
||||
@ApiOperation({ summary: 'Create a fully editable custom product' })
|
||||
createCustom(@Body() dto: CreateCustomGoodDto) {
|
||||
return this.service.createCustom(dto);
|
||||
}
|
||||
|
||||
@Patch(':id/custom-content')
|
||||
@ApiOperation({ summary: 'Update editable content for a custom product' })
|
||||
updateCustomContent(
|
||||
@Param('id', ParseIntPipe) id: string,
|
||||
@Body() dto: UpdateCustomGoodContentDto,
|
||||
) {
|
||||
return this.service.updateCustomContent(BigInt(id), dto);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get one good with relations' })
|
||||
findOne(@Param('id', ParseIntPipe) id: string) {
|
||||
|
||||
Reference in New Issue
Block a user