Fix set-alias endpoint: return HTTP 200 with normalized error key on failure

Agent-Logs-Url: https://github.com/netalertx/NetAlertX/sessions/05ab18a3-4ac2-492d-bb80-67a1cc089bd9

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-08 23:28:50 +00:00
committed by GitHub
parent 6eaa477ed3
commit a6d3b85614

View File

@@ -587,7 +587,8 @@ def api_device_set_alias(mac, payload=None):
result = device_handler.updateDeviceColumn(mac, 'devName', alias)
if not result.get("success"):
return jsonify(result), 404
err = result.get("error") or result.get("message") or f"Failed to update alias for device {mac}"
return jsonify({"success": False, "error": err})
return jsonify(result)