summaryrefslogtreecommitdiffstats
path: root/server/api/registration.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-04-01 02:43:48 +0200
committerJannik Schönartz2019-04-01 02:43:48 +0200
commitc10e0aab20ce8d49e6f7a8e31f1c4a3b4c86260d (patch)
treeffc41a353b03919a1ac148fa3e17931ebf68856d /server/api/registration.js
parent[server/ipxeconfigs] add more responses (diff)
downloadbas-c10e0aab20ce8d49e6f7a8e31f1c4a3b4c86260d.tar.gz
bas-c10e0aab20ce8d49e6f7a8e31f1c4a3b4c86260d.tar.xz
bas-c10e0aab20ce8d49e6f7a8e31f1c4a3b4c86260d.zip
[server/external-backends] Add direct sync in idoit for some functions (create client, add/remove client to/from groups)
Diffstat (limited to 'server/api/registration.js')
-rw-r--r--server/api/registration.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/api/registration.js b/server/api/registration.js
index 0a9a4cb..e3ca350 100644
--- a/server/api/registration.js
+++ b/server/api/registration.js
@@ -129,7 +129,6 @@ noAuthRouter.postAsync('/clients', async (req, res) => {
// Client does not exist.
if (!client.parents) client.parents = []
// TODO: Save all IPs? Maybe only primary ip?
- // const createClient = { name: client.name, description: client.type, ip: client.network.ip, mac: client.network.mac, uuid: client.uuid }
const createClient = { name: client.name, description: client.type, ip: client.networks[0].ip, mac: client.networks[0].mac, uuid: client.uuid }
if (client.type === 'CLIENT') createClient.registrationState = await getNextHookScript(client.parents)
const newClient = await db.client.create(createClient)
@@ -138,7 +137,7 @@ noAuthRouter.postAsync('/clients', async (req, res) => {
// Add groups to the client.
if (client.parents.length === 0) client.parents = await ipHelper.getGroups(client.networks[0].ip)
client.parents.forEach(pid => { newClient.addGroup(pid) })
- log({ category: 'CLIENT_REGISTRATION', description: 'Client added successfully.', clientId: newClient.id })
+ log({ category: 'REGISTRATION', description: 'Client added successfully.', clientId: newClient.id })
// Add the client to the backends.
const result = await backendHelper.addClient(client)