fix code so error is a key of json {"error":"EUtranCells[Kcell]: cannot be blank;…
- User
fix code so error is a key of json {"error":"EUtranCells[Kcell]: cannot be blank; \u0026{{ GRBS_41132_YUGCITY_1_KKT [] [] [Kcell] [] [] false} map[] map[]}"} code : // draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData if (data.children[node].EUtranCellData != error) { const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([data.children[node].EUtranCellData,data.children[node].ENodeB])) form.appendChild(sec) } })
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData; if (cellData.error) { // check if "error" is a key of cellData const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([cellData.data, data.children[node].ENodeB])); form.appendChild(sec); } });
- User
change if ti if not
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData; if (!cellData.error) { // check if "error" is not a key of cellData const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([cellData.data, data.children[node].ENodeB])); form.appendChild(sec); } });
- User
change code so following code will execute only if celldata key is not error const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([data.children[node].EUtranCellData,data.children[node].ENodeB])) form.appendChild(sec) }
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData; if (!cellData.hasOwnProperty("error")) { // check if "error" is not a key of cellData const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([cellData, data.children[node].ENodeB])); form.appendChild(sec); } });
- User
celldata is EUtranCellData: Error columnNumber: 10 fileName: "http://localhost:3000/public/js/fetchAPI.js" lineNumber: 18 message: "EUtranCells[Kcell]: cannot be blank; &{{ GRBS_41132_YUGCITY_1_KKT [] [] [Kcell] [] [] false} map[] map[]}" stack: "apiData@http://localhost:3000/public/js/fetchAPI.js:18:10\nasync*euCellsv2@http://localhost:3000/public/js/fetchAPI.js:527:9\nfetchEranData/</</<@http://localhost:3000/public/js/tools/lte/crElasticRan.js:80:13\nfetchEranData/</<@http://localhost:3000/public/js/tools/lte/crElasticRan.js:76:28\npromise callbackfetchEranData/<@http://localhost:3000/public/js/tools/lte/crElasticRan.js:73:5\nfetchEranData@http://localhost:3000/public/js/tools/lte/crElasticRan.js:10:9\ncrElasticRan/<@<@<@ callback@" : Error.prototype
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData; if (!cellData.hasOwnProperty("error")) { // check if "error" is not a key of cellData const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([cellData, data.children[node].ENodeB])); form.appendChild(sec); } });
- User
correct code // draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData if (cellData.hasOwnProperty("error")) else { const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([data.children[node].EUtranCellData,data.children[node].ENodeB])) form.appendChild(sec) } })
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const cellData = data.children[node].EUtranCellData; if (cellData.hasOwnProperty("error")) { // check if "error" is a key of cellData // code to handle the presence of error key, if needed } else { const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([cellData, data.children[node].ENodeB])); form.appendChild(sec); } });
- User
optimize code
- Assistant
// draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const { EUtranCellData, ENodeB } = data.children[node]; if (!EUtranCellData.hasOwnProperty("error")) { // check if "error" is not a key of EUtranCellData const sec = document.createElement('section'); sec.appendChild(draw.eutranCellsCosite([EUtranCellData, ENodeB])); form.appendChild(sec); } });