Files
iDRAC_Info/backend/routes/catalog_sync.py
2025-10-21 20:29:39 +09:00

24 lines
747 B
Python

# backend/routes/catalog_sync.py
from flask import Blueprint, jsonify, request
from backend.services.dell_catalog_sync import sync_dell_catalog
catalog_bp = Blueprint("catalog", __name__, url_prefix="/catalog")
@catalog_bp.route("/sync", methods=["POST"])
def sync_catalog():
"""Dell Catalog 버전 정보를 동기화 (CSRF 보호 유지)"""
try:
data = request.get_json(silent=True) or {}
model = data.get("model", "PowerEdge R750")
sync_dell_catalog(model)
return jsonify({
"success": True,
"message": f"{model} 동기화 완료"
})
except Exception as e:
return jsonify({
"success": False,
"message": f"오류: {str(e)}"
})