fix: set tnc accepted api

This commit is contained in:
2025-11-10 12:20:04 +05:30
parent f922179765
commit a28c08f8b2

View File

@@ -372,9 +372,10 @@ async function getTncAcceptanceFlag(req, res) {
async function setTncAcceptanceFlag(req, res) {
try {
const { flag } = req.body;
if (typeof flag !== 'boolean')
res.staus(400).json({ error: 'invalid value for flag' });
if (flag !== 'Y' && flag !== 'N')
res.status(400).json({ error: 'invalid value for flag' });
await authService.setTncFlag(req.user, req.client, flag);
return res.json({ message: 'SUCCESS' });
} catch (error) {
logger.error(error, 'error occured while updating tnc flag');
res.status(500).json({ error: 'INTERNAL SERVER ERROR' });