summaryrefslogtreecommitdiffstats
path: root/server/api/registration.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/api/registration.js')
-rw-r--r--server/api/registration.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/api/registration.js b/server/api/registration.js
index 4d2bda1..2ebf522 100644
--- a/server/api/registration.js
+++ b/server/api/registration.js
@@ -219,6 +219,7 @@ noAuthRouter.postAsync('/clients', async (req, res) => {
noAuthRouter.postAsync('/clients/:uuid', async (req, res) => {
let client = req.body.client
+ if (typeof client === 'string') client = JSON.parse(client)
if (client && client.ram && client.ram.modules) {
// Add the name to the ram modules.
@@ -228,9 +229,10 @@ noAuthRouter.postAsync('/clients/:uuid', async (req, res) => {
}
}
- const clientDb = await db.client.findOne({ where: { uuid: client.uuid } })
+ const clientDb = await db.client.findOne({ where: { uuid: req.params.uuid } })
if (!clientDb) return res.status(404).send({ error: 'CLIENT_NOT_FOUND', message: 'There is no client matching the provided uuid.' })
if (client.name) clientDb.update({ name: client.name })
+ else client.name = clientDb.name
client.id = clientDb.id
if (client && client.system) {