Merge pull request #1600 from netalertx/copilot/fix-api-error-response

Fix set-alias endpoint: return HTTP 200 with normalized `error` key on failure
This commit is contained in:
Jokob @NetAlertX authored and GitHub committed 2026-04-09 09:58:36 +10:00
commit 16e2249d0d
1 file changed
+2 -1
+2 -1
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)