also set nym

This commit is contained in:
counterweight 2025-02-14 01:56:41 +01:00
parent 6b52d06b3e
commit 90d8e39eb3
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
4 changed files with 82 additions and 3 deletions

View file

@ -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;