diff --git a/src/assets/helper.ts b/src/assets/helper.ts index 1f4a535..8b4a003 100644 --- a/src/assets/helper.ts +++ b/src/assets/helper.ts @@ -72,7 +72,7 @@ export function parseIntRelation(data: string, relation_name: string = 'id', doN // This can be used by prisma to connect relations // If the incoming data is null or empty, return a prisma disconnect object instead of a connect one - if (data === null || data === '') { + if (data === null || data === '' || data === "undefined") { if (doNotDisconnect) { return undefined; } diff --git a/src/frontend/manage/storageManager.eta.html b/src/frontend/manage/storageManager.eta.html index 80a07f5..c6398e3 100644 --- a/src/frontend/manage/storageManager.eta.html +++ b/src/frontend/manage/storageManager.eta.html @@ -150,37 +150,16 @@ > -
Name | -Storage Unit | -Actions | +Name | +Storage Unit | +Actions |
---|---|---|---|---|---|
<%= locations.name %> | -- <% if (locations.storageUnit == null) { %> - No storage unit connected - <% } else { %> <%= locations.storageUnit.name %> <% } %> - | -- - - | -
Name | -Address | -Actions | +Name | +Address | +Actions |
---|---|---|---|---|---|
<%= units.name %> | -<%= units.contactInfo.street %> <%= units.contactInfo.houseNumber %>, <%= units.contactInfo.city %> <%= units.contactInfo.country %> | -- - - | -
${item.SKU}
` + }); + ///// --------------------------------- ///// + setTimeout(() => { + activateTooltips(); + }, 200); + return { rows: json, total: total, totalNotFiltered: totalNotFiltered, totalRows: total }; +} + +function dataResponseHandlerUnit(json) { + // console.log(json) + totalNotFiltered = json.totalNotFiltered; + total = json.total; + json = json.items; + json.forEach((item) => { + colorStatus = ''; + item.actions = ` + + `; + if (item.contactInfo == null) { + item.address = 'No address assigned'; + } else { + item.address = `${item.contactInfo.street} ${item.contactInfo.houseNumber}, ${item.contactInfo.city} ${item.contactInfo.country}`; + } + + // item.SKU = `${item.SKU}
` + }); + ///// --------------------------------- ///// + setTimeout(() => { + activateTooltips(); + }, 200); + return { rows: json, total: total, totalNotFiltered: totalNotFiltered, totalRows: total }; +} + +handleSelector();