From 4e2fb9c1eb51d877ba9a0655d7c141210e48c62a Mon Sep 17 00:00:00 2001 From: Steve Patrick <29751037+audiobibleplayer@users.noreply.github.com> Date: Tue, 15 May 2018 20:17:56 +0800 Subject: [PATCH] issue_8: Unable to assign IP for member without name --- src/controllers/networkController.js | 12 ++++++------ src/package-lock.json | 2 +- src/package.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controllers/networkController.js b/src/controllers/networkController.js index 9d7127f..37bceae 100644 --- a/src/controllers/networkController.js +++ b/src/controllers/networkController.js @@ -83,7 +83,7 @@ exports.network_create_post = async function(req, res) { const errors = req.validationErrors(); - const name = { name: req.body.name }; + let name = { name: req.body.name }; if (errors) { res.render('network_create', {title: 'Create Network', nav: nav, name: name, errors: errors}); @@ -170,7 +170,7 @@ exports.name = async function(req, res) { const errors = req.validationErrors(); - const name = { name: req.body.name }; + let name = { name: req.body.name }; if (errors) { try { @@ -410,7 +410,7 @@ exports.member_detail = async function(req, res) { try { const network = await zt.network_detail(req.params.nwid); const member = await zt.member_detail(req.params.nwid, req.params.id); - const name = await storage.getItem(member.id); + let name = await storage.getItem(member.id); if (!name) name = ''; member.name = name; nav.whence = '/controller/network/' + network.nwid + '/members'; @@ -431,7 +431,7 @@ exports.member_object = async function(req, res) { try { const network = await zt.network_detail(req.params.nwid); const member = await zt.member_detail(req.params.nwid, req.params.id); - const name = await storage.getItem(member.id); + let name = await storage.getItem(member.id); if (!name) name = ''; member.name = name; nav.whence = '/controller/network/' + network.nwid + '/members'; @@ -672,7 +672,7 @@ exports.delete_ip = async function(req, res) { const network = await zt.network_detail(req.params.nwid); let member = await zt.member_detail(req.params.nwid, req.params.id); nav.whence = '/controller/network/' + network.nwid + '/members'; - const name = await storage.getItem(member.id); + let name = await storage.getItem(member.id); if (!name) name = ''; member.name = name; if (req.params.index) { @@ -738,7 +738,7 @@ exports.assign_ip = async function(req, res) { member = await zt.ipAssignmentAdd(network.nwid, member.id, ipAssignment); } - const name = await storage.getItem(member.id); + let name = await storage.getItem(member.id); if (!name) name = ''; member.name = name; diff --git a/src/package-lock.json b/src/package-lock.json index 0e7e3ec..7eac636 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,6 +1,6 @@ { "name": "ztncui", - "version": "0.4.1", + "version": "0.4.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/package.json b/src/package.json index 3b60d2b..384630f 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "ztncui", - "version": "0.4.2", + "version": "0.4.3", "private": true, "scripts": { "start": "node ./bin/www",