feat: Add BOM version activation feature and enhance BOM management
- Implemented the `activateBomVersion` function in the BOM controller to allow activation of specific BOM versions. - Updated BOM routes to include the new activation endpoint for BOM versions. - Enhanced the BOM service to handle version activation logic, including status updates and BOM header version changes. - Improved the BOM version modal to support version activation with user confirmation and feedback. - Added checks to prevent deletion of active BOM versions, ensuring data integrity.
This commit is contained in:
@@ -93,6 +93,19 @@ export async function loadBomVersion(req: Request, res: Response) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function activateBomVersion(req: Request, res: Response) {
|
||||
try {
|
||||
const { bomId, versionId } = req.params;
|
||||
const { tableName } = req.body || {};
|
||||
|
||||
const result = await bomService.activateBomVersion(bomId, versionId, tableName);
|
||||
res.json({ success: true, data: result });
|
||||
} catch (error: any) {
|
||||
logger.error("BOM 버전 사용 확정 실패", { error: error.message });
|
||||
res.status(500).json({ success: false, message: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteBomVersion(req: Request, res: Response) {
|
||||
try {
|
||||
const { bomId, versionId } = req.params;
|
||||
|
||||
Reference in New Issue
Block a user