mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-09 03:31:51 -07:00
Merge pull request #1600 from netalertx/copilot/fix-api-error-response
Some checks are pending
🐳 ⚠ docker-unsafe from next_release branch / docker_dev_unsafe (push) Waiting to run
Some checks are pending
🐳 ⚠ docker-unsafe from next_release branch / docker_dev_unsafe (push) Waiting to run
Fix set-alias endpoint: return HTTP 200 with normalized `error` key on failure
This commit is contained in:
@@ -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