feat(products): include ownerId in product creation and enforce its requirement
This commit is contained in:
@@ -128,8 +128,8 @@ export class ProductsController {
|
||||
|
||||
@Roles('admin')
|
||||
@Post()
|
||||
create(@Body() body: CreateProductDto) {
|
||||
return this.productsService.create(body);
|
||||
create(@Body() body: CreateProductDto, @Request() req: { user: { id: number } }) {
|
||||
return this.productsService.create(body, req.user.id);
|
||||
}
|
||||
|
||||
// Tillgänglig för alla inloggade användare — req.user.id injiceras av JWT-guard
|
||||
|
||||
Reference in New Issue
Block a user