also set nym
This commit is contained in:
parent
6b52d06b3e
commit
90d8e39eb3
4 changed files with 82 additions and 3 deletions
|
|
@ -115,6 +115,34 @@ router.post(
|
|||
success: true,
|
||||
message: 'Contact details set successfully.'
|
||||
})
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/set-nym",
|
||||
rejectIfNotAuthorizedMiddleware,
|
||||
attachPublicKeyMiddleware,
|
||||
async (req, res) => {
|
||||
const nym = req.body.nym;
|
||||
const publicKey = req.cookies.publicKey;
|
||||
|
||||
if (!nym) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: 'Missing nym'
|
||||
})
|
||||
}
|
||||
|
||||
await profileService.setNym(
|
||||
publicKey,
|
||||
nym
|
||||
)
|
||||
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
message: 'Nym set successfully.'
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue