mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-08 19:21:37 -07:00
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:
committed by
GitHub
parent
6eaa477ed3
commit
a6d3b85614
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user