feat: module toggles in POS config and Instance Manager
- Add GET/PUT /pos/api/config/modules endpoints in POS config_bp.py - Update sidebar.js to filter nav items based on enabled modules - Add Modules section to POS config.html with toggles for WhatsApp, Marketplace, MercadoLibre - Add module load/save logic to POS config.js - Preload modules in app-init.js for sidebar caching - Add tenant module management to Instance Manager - get_tenant_modules / update_tenant_modules in tenant_service.py - GET/PUT /api/tenants/<id>/modules endpoints in tenants_bp.py - Add modules modal to manager index.html - Add module editing UI and logic to manager.js - Add toggle-switch CSS to manager.css
This commit is contained in:
@@ -58,3 +58,24 @@ def delete_tenant(tenant_id):
|
||||
return jsonify(result)
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
|
||||
@tenants_bp.route("/<int:tenant_id>/modules", methods=["GET"])
|
||||
@require_manager_auth
|
||||
def get_tenant_modules(tenant_id):
|
||||
try:
|
||||
result = tenant_service.get_tenant_modules(tenant_id)
|
||||
return jsonify({"data": result})
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
|
||||
@tenants_bp.route("/<int:tenant_id>/modules", methods=["PUT"])
|
||||
@require_manager_auth
|
||||
def update_tenant_modules(tenant_id):
|
||||
data = request.get_json() or {}
|
||||
try:
|
||||
result = tenant_service.update_tenant_modules(tenant_id, data)
|
||||
return jsonify(result)
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
Reference in New Issue
Block a user