feat: add private product management endpoints for updating canonical names and merging products
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -140,6 +140,26 @@ export class ProductsController {
|
||||
return this.productsService.createPending(body, req.user.id);
|
||||
}
|
||||
|
||||
// ── Privata produkter: rename & merge ──────────────────────────────────────
|
||||
// Inloggade användare kan hantera sina egna privata produkter
|
||||
|
||||
@Patch('private/:id/canonical-name')
|
||||
updateCanonicalNamePrivate(
|
||||
@Param('id', ParseIntPipe) id: number,
|
||||
@Body() body: UpdateCanonicalNameDto,
|
||||
@Request() req: { user: { id: number } },
|
||||
) {
|
||||
return this.productsService.updateCanonicalNamePrivate(req.user.id, id, body.canonicalName);
|
||||
}
|
||||
|
||||
@Post('private/merge')
|
||||
mergePrivate(
|
||||
@Body() body: MergeProductsDto,
|
||||
@Request() req: { user: { id: number } },
|
||||
) {
|
||||
return this.productsService.mergePrivate(req.user.id, body.sourceProductId, body.targetProductId);
|
||||
}
|
||||
|
||||
@Roles('admin')
|
||||
@Post('merge')
|
||||
merge(@Body() body: MergeProductsDto) {
|
||||
|
||||
Reference in New Issue
Block a user