feat(inventory): expose simple F7 create endpoint
This commit is contained in:
@@ -4,10 +4,14 @@ import { RequirePermissions } from '../authorization/decorators/require-permissi
|
||||
import type { AuthPrincipal, RequestWithContext } from '../common/http/request-context';
|
||||
import { CreateInventoryStructureDto } from './dto/create-inventory-structure.dto';
|
||||
import { InventoryStructureService } from './inventory-structure.service';
|
||||
import { SimpleInventoryStructureService } from './simple-inventory-structure.service';
|
||||
|
||||
@Controller('inventory-structure')
|
||||
export class InventoryStructureController {
|
||||
constructor(private readonly inventoryStructure: InventoryStructureService) {}
|
||||
constructor(
|
||||
private readonly inventoryStructure: InventoryStructureService,
|
||||
private readonly simpleInventoryStructure: SimpleInventoryStructureService,
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
@RequirePermissions('assets.read')
|
||||
@@ -24,6 +28,17 @@ export class InventoryStructureController {
|
||||
return this.inventoryStructure.parents(kind, search);
|
||||
}
|
||||
|
||||
@Post('simple')
|
||||
@RequirePermissions('assets.create')
|
||||
createSimple(
|
||||
@Body() dto: CreateInventoryStructureDto,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.simpleInventoryStructure.create(dto, principal, request);
|
||||
}
|
||||
|
||||
// Compatibilidad temporal con el alta anterior. La WEB F7 utiliza /simple.
|
||||
@Post()
|
||||
@RequirePermissions('assets.create')
|
||||
create(
|
||||
|
||||
Reference in New Issue
Block a user