allow to register name
Change-Id: I72862e179253cdc9af4c8c381282745281f9c9d8
diff --git a/routes/jami.js b/routes/jami.js
index d76462e..28c4a05 100644
--- a/routes/jami.js
+++ b/routes/jami.js
@@ -30,7 +30,12 @@
console.log("Create new account")
console.log(req.body)
try {
- res.json({ accountId: await this.jami.addAccount(req.body) })
+ const accountId = await this.jami.addAccount(req.body)
+ if (req.body.registerName) {
+ this.jami.registerName(accountId, "", req.body.registerName)
+ .then(result => console.log("Name registrtion result: " + result))
+ }
+ res.json({ accountId })
} catch (e) {
res.status(400).json({ error: e })
}