diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 0a34d582c..33d004108 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 75a47192a..8bee87505 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/buttons/connectionToggle.ts b/netbox/project-static/src/buttons/connectionToggle.ts index 6485bbb50..74b32dc3a 100644 --- a/netbox/project-static/src/buttons/connectionToggle.ts +++ b/netbox/project-static/src/buttons/connectionToggle.ts @@ -8,12 +8,12 @@ import { isTruthy, apiPatch, hasError, getElements } from '../util'; * @param element Connection Toggle Button Element */ function toggleConnection(element: HTMLButtonElement): void { - const id = element.getAttribute('data'); + const url = element.getAttribute('data-url'); const connected = element.classList.contains('connected'); const status = connected ? 'planned' : 'connected'; - if (isTruthy(id)) { - apiPatch(`/api/dcim/cables/${id}/`, { status }).then(res => { + if (isTruthy(url)) { + apiPatch(url, { status }).then(res => { if (hasError(res)) { // If the API responds with an error, show it to the user. createToast('danger', 'Error', res.error).show(); diff --git a/netbox/templates/dcim/inc/cable_toggle_buttons.html b/netbox/templates/dcim/inc/cable_toggle_buttons.html index 3fe34acd7..77db3093f 100644 --- a/netbox/templates/dcim/inc/cable_toggle_buttons.html +++ b/netbox/templates/dcim/inc/cable_toggle_buttons.html @@ -1,10 +1,10 @@ {% if perms.dcim.change_cable %} {% if cable.status == 'connected' %} - {% else %} - {% endif %}