Merge pull request #318 from eReuse/bugfix/remove-tag

fix get id from js
This commit is contained in:
cayop 2022-07-21 16:49:18 +02:00 committed by GitHub
commit 7ff9673bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -216,7 +216,7 @@ function removeLot() {
function removeTag() {
const devices = TableController.getSelectedDevices();
const devices_id = devices.map(dev => dev.data);
const devices_id = devices.map(dev => $(dev).attr('data'));
if (devices_id.length == 1) {
const url = "/inventory/tag/devices/".concat(devices_id[0], "/del/");
@ -228,7 +228,7 @@ function removeTag() {
function addTag() {
const devices = TableController.getSelectedDevices();
const devices_id = devices.map(dev => dev.data);
const devices_id = devices.map(dev => $(dev).attr('data'));
if (devices_id.length == 1) {
$("#addingTagModal .pol").hide();

View File

@ -207,7 +207,7 @@ function removeLot() {
function removeTag() {
const devices = TableController.getSelectedDevices();
const devices_id = devices.map(dev => dev.data);
const devices_id = devices.map(dev => $(dev).attr("data"));
if (devices_id.length == 1) {
const url = `/inventory/tag/devices/${devices_id[0]}/del/`;
window.location.href = url;
@ -218,7 +218,7 @@ function removeTag() {
function addTag() {
const devices = TableController.getSelectedDevices();
const devices_id = devices.map(dev => dev.data);
const devices_id = devices.map(dev => $(dev).attr("data"));
if (devices_id.length == 1) {
$("#addingTagModal .pol").hide();
$("#addingTagModal .btn-primary").show();